margin icon indicating copy to clipboard operation
margin copied to clipboard

What characters can be escaped?

Open mtsknn opened this issue 4 years ago • 1 comments

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 be foo and the value would be bar.
    • The type of [foo\:bar] would be foo:bar and there would be no value.
  • 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.)

mtsknn avatar May 20 '20 18:05 mtsknn

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.

gamburg avatar Oct 30 '20 17:10 gamburg