vim-pandoc-syntax
vim-pandoc-syntax copied to clipboard
broken highlighting after pre-formatted code in lists
There are some problem with syntax highlighting of code blocks (or inline code) within lists.
The following demonstrates the problem (copy this to a markdown document, and open
with `pandoc` syntax highlighting):
1. In principle, there is support for lists. Line breaks in the list
are no problem.
Even multiple paragraphs are supported. However, there is a problem with
code blocks nested within lists, e.g.
#!/usr/bin/env python
print("Hello World")
The paragraph following the code block (this paragraph) is still recognized
as code, not as a continuation of the list
2. Also, when breaking a line such that
`code` happens to be at the beginning of a new line within a list, that line
(and subsequent lines) are recognized as a code block, not a continuation of
the list. Presumably, it's because '`' is not considered a letter
This problem continues on for the subsequent paragraphs as well
3. Only a new list item returns to the proper formatting
Another example for that, in which a multi-line code block is marked with ```:
- before
- ```python
print("multiline code sample")
```
- after
Another example for point 2:
- Some text as a paragraph,
this is the second line
<http://example.com/> and now starting
with the URL everything is highlighted as a code block.
I found this while using the equalprg
auto-formatting: it inserted two spaces between -
and First item
. This means that for equalprg
-formatted lists, the aligning column for the rest of the paragraph is always 4. Then if a line of the paragraph starts with a punctuation character (here <
), the rest of the paragraph is wrongly highlighted as a code block.