I recently upgraded to vim 8.2.0100 on Mac, and the markdown highlighting appears to have changed to be buggy.
Here is an example:
Normal syntax *Highlighting has started* Highlight continues Highlight continues...
meaning the second
* does not stop the highlighting on italics.
I see that
echo &filetype returns
markdown, and that
:scriptnames includes (among many other files)
In the markdown syntax file, I see:
" start matches a non-whitespace character if preceeded by a * OR a * followed by a non-whitespace character. " end matches a non-whitespace character if preceeded by a * OR a * followed by a non-whitespace character exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" skip="\\*" contains=markdownLineStart,@Spell' . s:concealends
The comments are my own attempt to understand the syntax.
I have tried changing it a bunch, including just setting
end="xc", but that doesn't work; I have the same problem where the start turns on the highlighting, but the end fails to turn it off.
This happens even with
vim <filename> -u NONE (after I set the filetype to markdown and turn on syntax), meaning my
.vimrc is not related
What am I missing in how to edit syntax files, or why doesn't the
end get any matches?
Edit: I have noticed that it also does not work with Bold (
**Bold**), and the bold will continue on through the rest of the document. Other segments, notably
```, do stop their changes.