[GH-ISSUE #972] MD032: Example in documentation uses lazy continuation and is not an example of a violation #2424

Closed
opened 2026-03-07 20:07:38 +03:00 by kerem · 5 comments
Owner

Originally created by @skwde on GitHub (Sep 13, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/972

Following pic shows the problem:

Screenshot 2023-09-13 at 10 22 33

MD032 only shows up for the line above a list and ignores the one below.
It also only adds a blank line after Some text

According to https://github.com/DavidAnson/markdownlint/blob/main/doc/md032.md a blank line should be added before and after list items.

Originally created by @skwde on GitHub (Sep 13, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/972 Following pic shows the problem: <img width="707" alt="Screenshot 2023-09-13 at 10 22 33" src="https://github.com/DavidAnson/vscode-markdownlint/assets/26454702/bb50b274-71d9-4669-9ae6-4cd135e6dd1e"> MD032 only shows up for the line above a list and ignores the one below. It also only adds a blank line after `Some text` According to https://github.com/DavidAnson/markdownlint/blob/main/doc/md032.md a blank line should be added before **and** after list items.
kerem 2026-03-07 20:07:38 +03:00
Author
Owner

@DavidAnson commented on GitHub (Sep 13, 2023):

According to the CommonMark specification, the text on line 11 of your image is a continuation of the list item above it and therefore a blank line should not be added because it would change the content of the list item. The specification calls this a "lazy continuation line" and you can see in the demo page that it's part of the second list item: https://dlaa.me/markdownlint/#%25m%23%20Issue%20300%0A%0A1.%20Some%0A2.%20List%0ASome%20text%0A

<!-- gh-comment-id:1718859192 --> @DavidAnson commented on GitHub (Sep 13, 2023): According to the CommonMark specification, the text on line 11 of your image is a continuation of the list item above it and therefore a blank line should not be added because it would change the content of the list item. The specification calls this a "lazy continuation line" and you can see in the demo page that it's part of the second list item: https://dlaa.me/markdownlint/#%25m%23%20Issue%20300%0A%0A1.%20Some%0A2.%20List%0ASome%20text%0A
Author
Owner

@skwde commented on GitHub (Sep 14, 2023):

Oh yes, you are of course right.

In that case I think that MD032 is confusing because it clearly states at https://github.com/DavidAnson/markdownlint/blob/main/doc/md032.md:

MD032 - Lists should be surrounded by blank lines

This is also highlighted through the example code and how it should be fixed.
But the linting is actually behaving differently.

Maybe an option can be added to opt-out lazy continuation line.

Not sure though if also something like this

1. abc
2. def
   ghi

also counts as laze continuation line, i.e. when spaces are added before the text on the lazy continuation line.

<!-- gh-comment-id:1718859195 --> @skwde commented on GitHub (Sep 14, 2023): Oh yes, you are of course right. In that case I think that MD032 is confusing because it clearly states at https://github.com/DavidAnson/markdownlint/blob/main/doc/md032.md: > MD032 - Lists should be surrounded by blank lines This is also highlighted through the example code and how it *should* be fixed. But the linting is actually behaving differently. Maybe an option can be added to opt-out lazy continuation line. Not sure though if also something like this ```markdown 1. abc 2. def ghi ``` also counts as laze continuation line, i.e. when spaces are added before the text on the lazy continuation line.
Author
Owner

@DavidAnson commented on GitHub (Sep 14, 2023):

Your latest example is a standard list (not lazy). I agree the example in the documentation is wrong and will use this issue to fix that, thank you.

<!-- gh-comment-id:1718859198 --> @DavidAnson commented on GitHub (Sep 14, 2023): Your latest example is a standard list (not lazy). I agree the example in the documentation is wrong and will use this issue to fix that, thank you.
Author
Owner

@skwde commented on GitHub (Sep 14, 2023):

Ahh ok. Can MD032 be extended such that one can choose if lazy line continuation is allowed or not.
I think lazy line continuation makes the markdown file fairly hard to read.

<!-- gh-comment-id:1719064656 --> @skwde commented on GitHub (Sep 14, 2023): Ahh ok. Can `MD032` be extended such that one can choose if lazy line continuation is allowed or not. I think lazy line continuation makes the markdown file fairly hard to read.
Author
Owner

@DavidAnson commented on GitHub (Sep 14, 2023):

Preventing lazy line conditions would be a new rule. Please open a separate issue for that if you'd like.

<!-- gh-comment-id:1719779695 --> @DavidAnson commented on GitHub (Sep 14, 2023): Preventing lazy line conditions would be a new rule. Please open a separate issue for that if you'd like.
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#2424
No description provided.