mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #1347] MD004 triggered on different lists #2515
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#2515
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 @ferrarimarco on GitHub (Sep 5, 2024).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1347
Hi! Thanks for working on this tool :)
I think Markdownlint might wrongly flagging the following snippet as a violation of MD004 set to its default configuration (
consistent).From my understanding of the CommonMark spec, this is allowed. Also, it's the only way to differentiate between different lists where there are only blank lines between them:
Input:
HTML output:
Here's a playground link that reproduces the issue.
Is there a way to configure
MD004to allow for this, besides disabling the rule entirely?Thanks!
@DavidAnson commented on GitHub (Sep 5, 2024):
The configuration says all lists should have the same style but the example has lists with different styles, so the rule reports a violation. This is correct and working as intended.
I think it is uncommon to have separate lists consecutively as in your example, but you can put an HTML comment between them if you want to avoid the warning by using the same list type twice in a row without content between. Or disable the rule for that file or part of it.
https://dlaa.me/markdownlint/#%25m%23%20H1%0A%0A1.%20list1%3A%20item%201%0A%0A%3C!--%20comment%20--%3E%0A%0A1.%20list2%3A%20item%202%0A%0A%3C!--%20comment%20--%3E%0A%0A1.%20list3%3A%20item%203%0A
@ferrarimarco commented on GitHub (Sep 5, 2024):
Yeah, makes sense. I guess I was asking for another option for MD004 along the lines of
subliststhat allowed this behavior.Anyway, thanks!