mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 01:05:55 +03:00
[GH-ISSUE #972] MD032: Example in documentation uses lazy continuation and is not an example of a violation #2424
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2424
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @skwde on GitHub (Sep 13, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/972
Following pic shows the problem:
MD032 only shows up for the line above a list and ignores the one below.
It also only adds a blank line after
Some textAccording to https://github.com/DavidAnson/markdownlint/blob/main/doc/md032.md a blank line should be added before and after list items.
@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
@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:
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
also counts as laze continuation line, i.e. when spaces are added before the text on the lazy continuation line.
@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.
@skwde commented on GitHub (Sep 14, 2023):
Ahh ok. Can
MD032be 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.
@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.