vim-pandoc / vim-pandoc-syntax

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

Syntax highlighting broken by ::: #370

Closed abudden closed 1 year ago

abudden commented 2 years ago

The ::: marks are used as divs in pandoc. If there is a line immediately after :::, it isn't highlighted properly. For example, in this file (generated by jupytext):

https://raw.githubusercontent.com/mwouts/jupytext/main/demo/World%20population.pandoc.md

Lines such as L20: # A quick insight at world population and L30: ``` {.python} are incorrectly highlighted. The highlighting can be "fixed" by adding a blank line, but this should not be required.

rivten commented 1 year ago

I think this is just because the given file is a Markdown but not a Pandoc Markdown file. Indeed as seen in the Pandoc Markdown docs:

Original Markdown syntax does not require a blank line before a heading. Pandoc does require this (except, of course, at the beginning of the document)

It is the same for backticks

Like regular code blocks, fenced code blocks must be separated from surrounding text by blank lines.

So I think your file is a valid markdown, but not a valid Pandoc Markdown, which is why it is not correctly highlighted.