1
Using Vim 7.4 on Windows in ConEmu (though I have seen the same thing on other platforms/setups), I notice that the syntax highlighting is matching the beginning and ending double-asterisks as italic sub-regions within the bold region that they denote. This is an eyesore:
After digging around, I think I have found the source of this problem (from $VIMRUNTIME/syntax/markdown.vim
):
syn region markdownItalic start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart
syn region markdownItalic start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart
syn region markdownBold start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic
syn region markdownBold start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic
syn region markdownBoldItalic start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart
syn region markdownBoldItalic start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart
And farther down:
hi def link markdownItalic htmlItalic
hi def link markdownBold htmlBold
hi def link markdownBoldItalic htmlBoldItalic
As you can see, the bold accepts italics as a subregion. The problem is if I remove markdownItalic
from the contains=
, this:
no longer works right:
even though it fixed the other problem. I also trying substituting \S
in the regexes for italic to be [^*]
but that didn't work either. Also, installing Plastic Boy's Markdown plugin didn't fix it.
Any ideas on how to get around this annoying case?
Another thing I don't understand is why the start and end are being matched as the same thing with an or in the middle. It would seem to me that one have of the or should be for start and one half for end. But then again, when you get regexes this complicated, it gets hard to know what all is going on and why... – Kazark – 2014-08-12T20:51:56.127
Figure out any solutions here? – George Mauer – 2015-04-29T13:42:19.977