Closed anthony-geoghegan closed 3 years ago
Thanks for the PR.
I've forked vim-markdown and applied this fix to my fork since this issue is a major deal-breaker. I am surprised more folks have not hit this.
Anyway, I hope this is fixed eventually.
Friendly ping. Any chance this could get merged?
Where the heck did that *
come from???
Where the heck did that
*
come from???
Gremlins!
In fairness, there were already a couple of *
in the original start
regular expression used to define the syntax region
. It’s an easy thing to forget to remove one. Regular expressions are powerful but the syntax isn’t very human-friendly. Having used Vim for close to 20 years, I still have to use trial-and-error to get a complicated pattern to work the way I want (missing backslashes, etc.). Related: http://regex.info/blog/2006-09-15/247
If a line begins (ignoring any space characters) with a word that happens to match one of the languages listed in
g:markdown_fenced_languages
, the line is wrongly detected as being the start of a fenced code-block for that language.As an example, the following line would be highlighted as the start of fenced code block and lines immediately following it are highlighted as SQL statements (until a blank line is reached).
This bug was introduced in the most recent commit where an extraneous asterisk allows for zero matches of the
\z(~\{3,\}\)
atom. This pull request should ensure that a line is only treated as the start of a fenced code block if the line begins with three or more consecutive backtick or tilde characters (with optional leading white-space).