vim-markdown icon indicating copy to clipboard operation
vim-markdown copied to clipboard

Don't apply markdown highlighting in HTML contexts

Open cespare opened this issue 13 years ago • 2 comments

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.)

cespare avatar Dec 07 '11 01:12 cespare

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 &#95;.

tpope avatar Mar 03 '12 11:03 tpope

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?

pablox-cl avatar Dec 19 '14 02:12 pablox-cl