tpope / vim-markdown

Vim Markdown runtime files
1.22k stars 191 forks source link

Use of fenced code block within block-quote breaks following highlighting for rest of file #207

Open phlummox opened 1 year ago

phlummox commented 1 year ago

If a fenced code block is found within a block quote, like so:

> intro text
>
> ```
> some code
> ```

then this breaks nearly all syntax highlighting for the remainder of the file. Headings still get highlighted (e.g. # my heading), but nothing else, so far as I can tell (e.g. angle-bracketed URLs like <http://example.com>, bold, and italic).

A workaround for this bug is to add an extra backtick somewhere afterwards, which can be within an HTML comment. Like so:

<!--
`
-->

But I assume that this is a bug, and that vim-markdown should be able to handle fenced code blocks within block quotes. Alternatively, if this is considered correct behaviour, then I'd suggest that should be mentioned in the README.

Other comments

Issue #190 reported what I believe is the same issue, but the creator of that issue closed it as they found a different workaround (installing a whole separate plugin). But I think don't think they were correct to close it - the fact that there is a workaround doesn't make this any less of a bug. (Besides, I could be wrong, but I don't think the plugin they suggest would work with vim 8, so their suggested workaround is not a solution for vim 8 users - on e.g. Ubuntu 20.04 systems, where vim 8 is the most current version.)