margin
margin copied to clipboard
What characters can be escaped?
Currently the documentation mentions only this regarding escaping:
Escape an annotation with a backslash:
This is an item \[but this is not an annotation]
What other characters can be escaped? Some thoughts:
- For consistency, I think that
]
should also be escapable (\]
). - Colons inside annotations could also be escapable to prevent the colon to be interpreted as the end of the annotation type. E.g.:
- The type of
[foo:bar]
would befoo
and the value would bebar
. - The type of
[foo\:bar]
would befoo:bar
and there would be no value.
- The type of
- How about ornamentation? E.g.
\- A bullet point
. -
\n
should likely be interpreted as a newline in the item's value (or annotation's type or value), right? Edit: Or actually, should it be possible to have newlines in an annotation's type or value? - Any other characters?
Also, how should the escape character be interpreted when it's used in front of non-escapable characters? E.g. should the value of foo \bar
be foo bar
, foo \\bar
or something else? (I don't know if this question makes much sense outside of JavaScript.)
Great. \[
and \]
make a lot of sense, as does escapable ornamentation.
My intuition is that colons being escapable feels very coder-centric -- I can't think of a real-world use case of this for a thinker. I suppose someone might want an annotation of type re:finances
or something? But it seems like a stretch, and easily circumventable by just specifying a different type (eg. finances
).
Then again, I can't think of a good reason why not to allow colons to be escapable, as maybe power users would find this useful once in a while, and the average user never needs to know about it. Seeing as it probably wouldn't weigh down the spec all that much, it seems ok.
And definitely I think the escape character \
should always be interpreted except when used in front of an escapable character.