DavidAnson / vscode-markdownlint

Markdown linting and style checking for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
MIT License
930 stars 170 forks source link

MD029 false positive with display math #333

Closed palapapa closed 5 months ago

palapapa commented 5 months ago

The following:

# 1

1. a

    1. asd

    $$
    123
    $$

    2. asd

triggers MD029, whereas the following:

# 1

1. a

    1. asd
    $$
    123
    $$

    2. asd

doesn't.

DavidAnson commented 5 months ago

The math content is not properly indented to be part of the nested list. In the second example, it immediately follows the list item content and so is treated as part of it. In the first example, the blank line means the math content ends the nested list. You can experiment with both forms in Source view here to see what I mean: https://markdown-it.github.io/

I believe the current behavior of markdownlint is correct based on how Markdown treats these two situations differently.

palapapa commented 5 months ago

Sorry, it was a mistake. The correct way to write it is:

# 1

1. a

    1. asd

        $$
        123
        $$

    2. asd