subconsciousnetwork / subtext

Markup for note taking
Apache License 2.0
273 stars 20 forks source link

Escape sigil at start of line #3

Closed nichtich closed 2 years ago

nichtich commented 3 years ago

Does \ at the start of a line escape the character, so it can be used at the start of a text block?:

\#
\&
\-
\\

If so, does it also act as escape character elsewhere like in Markdown?

gordonbrander commented 3 years ago

Great callout. \ is reserved for this reason. I wanted to give a bit of thought to how badly this might actually be needed. I notice Gemini, another line-oriented format does not currently define an escape sigil.

At the moment, the escape sequence would only see use as a proxy for "text sigil". There is currently no specified inline markup within Subtext, so an escape character is not needed inline at this time.

gordonbrander commented 3 years ago

Reflecting on this more, perhaps we should:

Rationale: removing the space-after-sigil character requirement allows us to extend the language in future without breaking old Subtext. Each Sigil becomes a sort of namespace, where we can add additional characters after the sigil if needed to create more sigils. This may be valuable if we introduce a syntax for e.g. metadata. I don't want to expand beyond single-character sigils for aesthetic reasons, but I'm also wary of painting myself into a corner. This change would be a hedge.

Of course, this means that there is more chance of collision, because the sigil is now less specific. These collisions should be rare, because the characters we've chosen as sigils are not typical characters that you would have leading a line of prose, but they could happen. So, we bring in the escape character to resolve the odd case of collisions.

nichtich commented 3 years ago

Having read the gemtext specification and some discussion around it I am not sure whether subtext requires a method to escape sigil. You could just prepend a space character instead. The question is whether leading space characters in text blocks are relevant. The statement "Text lines SHOULD be presented to the user in a manner suitable for general reading" indicates no.

gordonbrander commented 2 years ago

Agree. I'm going to close this for now.