Closed pannous closed 6 years ago
I was about to ask why the comma is needed at all
Thanks for the feedback.
Comma is added merely to make Mark a superset of JSON. And I think JSON has comma added, because it needs to follow JS syntax.
Now since Mark has already broken syntax compatibility with JS, we may consider removing the comma between properties, and it will be more like HTML/XML with less delimiter noise.
I think I can consider making comma optional, as you suggested, just like ';' is optional in JS.
However, if we do that, people may start to ask making ',' optional in array. Should that be optional as well?
@Good point. Thinking about it: Yes, commas should be optional everywhere:
{input type:email id:"email" class=[bold large] style={color:blue width:120} }
if one really needs spaces in identifiers, one can still quote them "strange key":[id1 "long id2" id3]
In one distant utopian future these variants will all have the same meaning
style:{color:blue width:120}
style={color:blue width=120}
style{color:blue width:120}
{style color:blue width:120}
people will cringe at remembering xml, where attributes and children where different.
Latest release has made both comma in properties and comma in array optional.
During stringify, the default behavior is still to write the commas, but there's an option now to turn it off.
{input type:"email", id:"email"}
ok{input type:"email" id:"email"}
ok