Hacker News new | ask | show | jobs
by winstonewert 441 days 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?"}]}`

2 comments

Oh sure, it can be represented. But now JSON is the one being noisy, ugly and verbose.
My 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.

But that's terrible! How is that better? And can you guarantee correct ordering?

  ["p", "How would you represent ", ["b", ["i", "mixed content"]], " in JSON?"]