3 ms·
I don't think your example needs to be quite so verbose. { 'ul': { 'li': 'hello!' } } I would think it would depend upon the parser. Regard
by talmand 13y ago
I don't think your example needs to be quite so verbose.
{
'ul': {
'li': 'hello!'
}
}
I would think it would depend upon the parser.
Regardless, I'd still rather write out HTML instead of JSON for markup.
- bct 13y agoThat breaks down as soon as you have something with attributes, and it breaks down even further once you have something like: <p>Example <b>text</b></p>
- talmand 13y agoYou see, this is why I don't create standards. I'm going to go with that JSON is the failure point with my grand vision.
- nobleach 13y agoNot sure your example would work in a real world situation. The UL would probably have an array attached as it can have multiple children. Then we get into the fact that all tags can have attributes, not just a text node.
- talmand 13y agoYou're right, I didn't consider attributes. In my simplified way the parser would need to know which keywords were attributes based on parent element versus keywords that are just new children elements. Which would defeat the purpose. I guess I'm not changing the world today.