Markdown parsing removes whitespaces after a marked up token: bug or feature? #1119
Unanswered
GauthierC-io
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In French, certain punctuation marks (!?:;«») as well as percentage signs must be preceded by a space (ideally a non-breaking one). I am trying to write a rule for markdown files, to catch the cases where the writer forgets to put one.
As such, I have a substitution rule along the lines of:
The issue is: it doesn't work if the punctuation mark follows a word surrounded by markup.
For example:
**If we do this** :The rule will throw a warning, matching "s:".
The same issue happens with other forms of markup. For example:
Also ignores the blank space and generates a warning matching "h!"
It seems whenever Vale parses the markup, the space is not considered to be part of any token and is thus removed before any rule is applied.
Scoping to raw fixes the issue by disabling all markup parsing, But it thus makes any semantic scoping impossible and generates false positives for a use-case like mine, e.g. in code blocks which rely on tons of colons and semi-colons. Besides, it prevents the use of in-document comments to disable the checking wherever needed. So it's not really a solution either.
Is this a known limitation? An actual feature with a reason to be? Or a bug?
All reactions