-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should attached modifier cares kind of escaped character? #28
Comments
I agree that the first example is invalid because the opening attached modifier does not have whitespace preceding it. |
If first example is valid, it means one of these:
In first case, second example should be invalid bold because |
what mrossinek proposes is sensible here. From the parser's perspective, this may indeed mean that it has to differentiate escaped punctuation versus escaped characters, but our rules in the spec are pretty explicit. They discuss the immediate previous and next characters, so the parser has to "figure it out" when it comes to escape sequences. On a side note, now that super verbatim could exist, what are your thoughts on escape characters in general? They're nice and convenient, but could they be superceded by some other syntax? |
Spec also says that repeated
My thoughts on escape characters haven’t changed from start. They should take precedence over all grammars except free-form (currently “super verbatim” and “verbatim ranged tag”.) |
Maybe I need to be more explicit. First, let me paraphrase the rules from the spec:
Given that, let us look at your first case:
The second case:
To paraphrase: the backslash escapes whatever character comes next, therefore rendering it verbatim. No differentiation on whatever is escaped has to be done. This escaping have higher precedence than all attached modifiers except the super verbatim suggested in #33. Otherwise writing inline math using LaTeX would be very cumbersome. (That however has some more discussion also here: #34 (comment)). We might want to re-evaluate the precedence of the backslash w.r.t. to linkables. |
So you are saying that parser should distinguish In my view, Having two different node types ( One possible solution to this would be disallowing escaped normal word character. Making |
I am explicitly stating:
An escaped character is just that: an escaped character. Any character can be escaped, whether that has any use, is another question, but not one that the spec should care about. An escaped character is neither whitespace nor punctuation. Therefore, an escaped character:
|
Oh I get it now. I haven’t thought like that. Sorry for misunderstanding. |
If escaped character cannot occur after a closing attached modifier, how can I write
Should I escape the |
Very simple:
The link modifier makes this possible because it is fine with not having whitespace after it. It may not even be necessary to escape the second colon character but I would have to double check that. |
So you are going to change this spec and redefine the attached modifier opening/closing tokens. |
In norg syntax,
\a
is equivalent toa
. But if\a
is just normal character,should not be a valid bold.
And if example above is not valid,
This must also be invalid.
This is tricky for parser because parser work at the token level.
The text was updated successfully, but these errors were encountered: