4 ms·
>> XML is superior to JSON for text documents. Far superior. > Why do you think so? Is it because most structured texts are Trees? XML allows for mixed conten
by kiriakasis 8y ago
>> XML is superior to JSON for text documents. Far superior.
> Why do you think so? Is it because most structured texts are Trees?
XML allows for mixed contents. If I am reading this proposal right to change
<span>Some <b>formatted</b> content.</span>
into
<span>Some <b>forma<i>t<i/>ted</b> content.</span>
you would essentially produce the equivalent of
<span>Some <b>forma<b/><b><i>t<i/><b>ted</b> content.
</span>
as the "text" field cannot contain childrens.
- kiriakasis 8y agowhich is what happens at https://react-prosemirror-example.now.sh/ https://react-prosemirror-example.now.sh/ wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww -> { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww" }, { "type": "hard_break" } ] } ] } and with bold in the middle { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "wwwwwwwwwwwwww" }, { "type": "text", "marks": [ { "type": "strong" } ], "text": "w" }, { "type": "text", "text": "wwwwwwwwwwwwwwwww" }, { "type": "hard_break" } ] } ] } This is not to say that is is a bad format, essentially XML does the same from an API level and maybe being explicit about it is good, but for sure is feels a bit different (again, do not want to express a better or worse). Overall I am happy from the simple fact that it does not have the overused "Markup Language" in the name.