5 ms·
`{ type: "p", children: [{type: "text", text: "How would you represent "}, {type: "b", children: [{type: "i", children: [{type: "text", text: "mixed content"}]]
by winstonewert 1y ago
`{ type: "p", children: [{type: "text", text: "How would you represent "}, {type: "b", children: [{type: "i", children: [{type: "text", text: "mixed content"}]], {type: "text", text: " in JSON?"]}`
or:
`{paragraphs: [{spans: [{
text: "How you represent "}, {bold: true, italic: true, text: "mixed content"},{text: " in JSON?"}]}`
- Finnucane 1y agoBut that's terrible! How is that better? And can you guarantee correct ordering?
- lioeters 1y ago["p", "How would you represent ", ["b", ["i", "mixed content"]], " in JSON?"]
- ssdspoimdsjvv 1y agoOh sure, it can be represented. But now JSON is the one being noisy, ugly and verbose.
- winstonewert 1y agoMy specific claim was that you could represent it in JSON, so you can't claim, as the post I responded to did, that JSON "cannot be used." I'll fully grant, I don't want to write a document by hand in either of the JSON formats I suggested. Although, given the choice, I'd rather receive it in that format to be parsed than in any XML format.