vim-markdown
vim-markdown copied to clipboard
Don't apply markdown highlighting in HTML contexts
Apologies for not including code; I took a stab at this but I couldn't figure out how to do it.
Basically, inside HTML tags, we should not apply markdown highlighting. Markdown engines shouldn't be applying any markdown formatting inside those tags. From the Markdown syntax docs:
Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can’t use Markdown-style emphasis inside an HTML block.
I ran into this when using some _
characters inside tables for a Github readme and had all the following text highlighted as if italic. (Github's markdown doesn't include table syntax, which is common in many markdown extensions, so I was using an inline <table>
element.)
Yeah, I can't think of a way to do this short of littering syntax/html.vim
with a bunch of Markdown exemptions. Markdown is a syntax highlighter's worst nightmare. :/
As a crude workaround, there's always _
.
Hm, I had a similar issue, when I tried to do this:
<kbd>[h</kbd>
Which results in the whole rest of the file highlighted as a reference (or until another [
or ]
is found, is there any workaround?