Replies: 2 comments
-
See also #174 |
Beta Was this translation helpful? Give feedback.
-
This does add a lot of complexity to the mental model. People have to remember which characters need We could think about the nature of the problem. |
Beta Was this translation helpful? Give feedback.
-
The situation that bracketed styles like
{_emph_}
and attributes use the same kind of (curly) brackets is a bit problematic since it precludes using punctuation characters which have special meaning in attributes as style indicators and vice versa.I’m thinking that maybe it could be possible to double the braces on style spans to disambiguate, i.e.
{{_emph_}}
,{{#some style#}}
. I know that djot rightly frowns on doubled delimiters like**foo**
, but IMHO braces are different because they are paired (the opening and closing delimiters are different chars) and thus it is possible to nest balanced braces to any depth, which is why the braced style span syntax exists in the first place, so I think this would be relatively benign. Naturally#
,.
,%
,=
,"
…) but they would be allowed with any style span._}}
can close{{_
and only_}
can close{_
), because that is much less confusing.The parser(s) would have to keep track of single and double braces separately, but probably the two could share most code anyway. E.g. in Lua you could (for the sake of argument) use
and stash the info about the match in different places depending on whether
#double == 0
or not.It would also be possible make some of the more esoteric span styles which currently require braces to require double braces, freeing up their marker characters for use in attributes, e.g.
[foo]{-lang}
/[foo]{+role}
vs.{{-del-}}
/{{+ins+}}
.I think this would be beneficial since the number of available ASCII punctuation characters is quite limited.
Beta Was this translation helpful? Give feedback.
All reactions