mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #480] MD029/ol-prefix - Ordered list item prefix not detected in sublist #394
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#394
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 @ogmios-voice on GitHub (Jan 17, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/480
In the following example instead of MD029/ol-prefix MD037/no-space-in-emphasis is reported (for every other line):
@DavidAnson commented on GitHub (Jan 17, 2022):
(The list items are indented more than necessary, but that is not the issue.)
CommonMark does not allow an ordered list to interrupt a paragraph unless it begins with the number 1. There is an example here in the specification and the explanation is just above: https://spec.commonmark.org/0.30/#example-304
Your example is therefore interpreted as a single unordered list item with asterisk characters embedded and so the errors you see reported are legitimate: https://dlaa.me/markdownlint/#%25m%23%20Issue%20480%0A%0A*%20text%0A%20%20%20%202.%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A%20%20%20%20%20%20%20%20*%20text%0A
Changing the 2 to a 1 in your example renders as expected and reports no errors.
@ogmios-voice commented on GitHub (Jan 19, 2022):
Yes, changing 2 to 1 fixes the issue, but the reported errors basically do not state anything about this.
Also is there a way to continue an ordered list from a given number (>1)? (e.g. using some html tags / comments)
@DavidAnson commented on GitHub (Jan 19, 2022):
I agree it would be nice if the tool could figure out all of the ways that Markdown might not do what the author intended, but in this case viewing the rendered output is a good clue about what's going wrong with the list definition.
For your question, please have a look at the discussion in #340 regarding starting a list at a different number.
"*"results in subsequent required header values being ignored #2178