vim-pandoc / vim-pandoc-syntax

pandoc markdown syntax, to be installed alongside vim-pandoc
MIT License
424 stars 61 forks source link

Wrong code-block syntax highlight while editing markdown files. #337

Closed Icy-Thought closed 3 years ago

Icy-Thought commented 4 years ago

The code-blocks for my markdown documents are not highlighted based on the desired language's syntax, rather based on a neutral code-block syntax-highlighting..

An example of how Rust-lang highlight is expected to look like: Screenshot from 2020-06-08 15-50-10

VS what is currently being displayed through vim-pandoc-syntax highlighting: Screenshot from 2020-06-08 15-50-30

dotcs commented 3 years ago

@Icy-Thought I had the same issue. What helped was to specify the languages which should be highlighted in the vimrc:

let g:pandoc#syntax#codeblocks#embeds#langs = ["bash", "python", "yaml", "vim"]

Maybe that also helps in your case?

For later reference: I used the current master commit (2521e2e9b99a3550e1a20f24e09fa46679cbbbc7).

alerque commented 3 years ago

What Fabian said is the correct answer. Rust is not in the default list of highlighted languages. I checked and it does work as long as you add it to your list.