Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MD029 (ol-prefix) and nested unordered lists in ordered lists #38

Closed
EvgenyOrekhov opened this issue Dec 5, 2016 · 2 comments
Closed
Labels

Comments

@EvgenyOrekhov
Copy link

If I use the following rule:

{
    "ol-prefix": {
        "style": "ordered"
    }
}

then markdownlint says "Ordered list item prefix (Expected: 1; Actual: 2)" to the following code:

1. a
- b
2. c
- d

It looks like markdownlint thinks that 2. c is the beginning of a new list, but it's the second item of the single ordered list.

If I indent the unordered lists, markdownlint says "Consider starting bulleted lists at the beginning of the line".

What is the correct way of using nested unordered lists in ordered lists?

@DavidAnson
Copy link
Owner

When indenting, did you use three spaces? The following should do what you want:

1. a
   - b
2. c
   - d

Markers for nested lists should begin under the text of the previous item - for numbered lists that's typically 3 vs. 2 spaces.

You can play around interactively here to see that markdown-it doesn't recognize the nested lists with just 2 spaces: https://dlaa.me/markdownlint/

@EvgenyOrekhov
Copy link
Author

@DavidAnson thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants