mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #429] New line doesnt restart list index, triggers MD029 #2206
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#2206
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 @wolf99 on GitHub (Sep 15, 2021).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/429
Using the following triggers MD029
Seems like markdownlint incorrectly continues index counting across the newline.
That is, it does not allow the new line between the lists to start a new list as far as the list index numbers are concerned.
Markdownlint v0.43.2 in MS VS Ccode 1.60.1 (seen on 1.60.0 also) on MS Windows 10 1909
@DavidAnson commented on GitHub (Sep 15, 2021):
The output is correct - this is a single list: https://markdown-it.github.io/#md3=%7B%22source%22%3A%221.%20first%20list%2C%20first%20item%5Cn2.%20first%20list%2C%20second%20item%5Cn%5Cn1.%20second%20list%2C%20first%20item%5Cn2.%20second%20list%2C%20second%20item%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22src%22%7D%7D
The specification calls out that blank lines are allowed between list items and do not "split" the list: https://spec.commonmark.org/0.30/#lists
@wolf99 commented on GitHub (Sep 15, 2021):
Oh.
I agree the spec does indicate that.
However, do you know is there then a recommended way to have two separate ordered lists, one after the other ?
@DavidAnson commented on GitHub (Sep 15, 2021):
Example 308 suggests an empty HTML comment: https://spec.commonmark.org/0.30/#example-308
@wolf99 commented on GitHub (Sep 16, 2021):
Yuck.
But it works 😅
@wolf99 commented on GitHub (Sep 16, 2021):
Doesn't this breach MD033?
https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md033---inline-html
@DavidAnson commented on GitHub (Sep 16, 2021):
No, comments are not elements and example 308 does not trigger any violations: https://dlaa.me/markdownlint/#%25m%23%20Example%20308%0A%0A-%20foo%0A-%20bar%0A%0A%3C!--%20--%3E%0A%0A-%20baz%0A-%20bim%0A