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

Highlight headers with Markdown groups

Open gera2ld opened this issue 5 years ago • 2 comments

Currently Markdown syntax groups are straightly named to HTML groups, e.g. htmlH1 instead of markdownH1.

But in some themes like onedark, vim-one, etc., Markdown highlight groups are different from those in HTML, which makes Markdown look weird after applying this plugin.

Before:

After (headers look the same as plain text):

Even in the built-in markdown.vim syntax, they use Markdown groups and then link them to the HTML ones, so that we can change Markdown highlights and keep the HTML ones if we want. But this is impossible in vim-markdown AFAICT.

Is there any reason why vim-markdown uses HTML groups instead of the Markdown ones? Is there any chance to change it so that we can benefit from other themes? Thanks.

gera2ld avatar Nov 07 '19 04:11 gera2ld

This strikes me as a major deficit. It's very uncommon to highlight the <h1>innerHTML</h1>, since everything that isn't syntax/tags is innerHTML. On the other hand, Markdown headers are not regular text but particular elements, and virtually all themes highlight them accordingly.

So vim-markdown should follow the approach of the syntax file that ships with vim.

adrian5 avatar Sep 27 '20 14:09 adrian5

Any updates on this? Headers look better (i.e. get highlighted) without the plugin than with it, which is a shame because I want to use it for the other functions. Would be great if it could just stick to `markdownH1 instead of reusing the html highlighting groups.

pinpox avatar Jun 28 '21 08:06 pinpox