[GH-ISSUE #189] MD031 not triggered in indented lists #2012

Closed
opened 2026-03-07 20:03:41 +03:00 by kerem · 3 comments
Owner

Originally created by @ranebrown on GitHub (May 21, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/189

When using fenced code blocks inside a list the 'MD031 - Fenced code blocks should be surrounded by blank lines' rule is not triggered due to the leading indentation.

- item 1
- item 2
    ```c
    int main()
    {
    return 0;
    }
    ```
- item 3
Originally created by @ranebrown on GitHub (May 21, 2019). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/189 When using fenced code blocks inside a list the 'MD031 - Fenced code blocks should be surrounded by blank lines' rule is not triggered due to the leading indentation. ```markdown - item 1 - item 2 ```c int main() { return 0; } ``` - item 3 ```
kerem 2026-03-07 20:03:41 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (May 22, 2019):

It looks to me like MD031 is triggered for the top and bottom fences of your example: https://dlaa.me/markdownlint/#%25m%23%20Issue%20189%0A%0A-%20item%201%0A-%20item%202%0A%20%20%20%20%60%60%60c%0A%20%20%20%20int%20main()%0A%20%20%20%20%7B%0A%20%20%20%20return%200%3B%0A%20%20%20%20%7D%0A%20%20%20%20%60%60%60%0A-%20item%203%0A

Could you please provide more detail about how to reproduce the issue?

<!-- gh-comment-id:494613973 --> @DavidAnson commented on GitHub (May 22, 2019): It looks to me like MD031 *is* triggered for the top and bottom fences of your example: https://dlaa.me/markdownlint/#%25m%23%20Issue%20189%0A%0A-%20item%201%0A-%20item%202%0A%20%20%20%20%60%60%60c%0A%20%20%20%20int%20main()%0A%20%20%20%20%7B%0A%20%20%20%20return%200%3B%0A%20%20%20%20%7D%0A%20%20%20%20%60%60%60%0A-%20item%203%0A Could you please provide more detail about how to reproduce the issue?
Author
Owner

@ranebrown commented on GitHub (May 22, 2019):

I'm using markdownlint-cli. I was using version 0.13.0 and seeing this issue but updating to the latest (0.16.0) seems to have resolved the problem. Sorry for the trouble.

<!-- gh-comment-id:494635276 --> @ranebrown commented on GitHub (May 22, 2019): I'm using [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli). I was using version 0.13.0 and seeing this issue but updating to the latest (0.16.0) seems to have resolved the problem. Sorry for the trouble.
Author
Owner

@DavidAnson commented on GitHub (May 22, 2019):

No worries, glad you sorted it out!

<!-- gh-comment-id:494645254 --> @DavidAnson commented on GitHub (May 22, 2019): No worries, glad you sorted it out!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#2012
No description provided.