vim-pandoc-syntax icon indicating copy to clipboard operation
vim-pandoc-syntax copied to clipboard

broken highlighting after pre-formatted code in lists

Open goerz opened this issue 7 years ago • 3 comments

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

goerz avatar Jan 10 '17 21:01 goerz

pandoc_syntaxbug

goerz avatar Jan 10 '17 21:01 goerz

Another example for that, in which a multi-line code block is marked with ```:

- before
- ```python
print("multiline code sample")
```
- after

schmittlauch avatar Aug 31 '17 12:08 schmittlauch

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.

knuesel avatar Dec 21 '18 14:12 knuesel