bug: nested list not working if indent by 2 spaces
See original GitHub issueVersions
- dumi: 1.1.20
- node: 15.6.0
- npm: 7.4.0
- OS: macOS 11.2.3 BigSur
- Browser: Firefox 89.0.1
Steps to reproduce
Create list with Markdown syntax then dumi dev
:
1. xx
1. xx
2. xx
What is Expected?
Rendered 2-level list.
What is actually happening?
Rendered single level list, but indent by more than 2 spaces will works properly.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Nested list requires 4 spaces instead of 2 · Issue #451
Most common Markdown editor uses 2 spaces as the indentation for nested list. But this library requires 4, and there's no way to...
Read more >Problem making sublists (or nested lists)?
If the list marker takes up two spaces of indentation, and there are three spaces between the list marker and the next character...
Read more >Nested numbered list indentation differs from bullet lists - GitLab
This bullet list worked, but this numbered one didn't. What is the current bug behavior? The following does not result the same as...
Read more >[Bug] Nesting a numbered list item by pressing tab doesn't ...
In settings → Editor, set “Tab size” to 2 and “Use tabs” to off. Create a numbered list. Try to make it a...
Read more >Nested ordered lists indented with 2 spaces are broken
To nest one list within another, indent each item in the sublist by four spaces. …But that doesn't work in the above example...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A point of clarification, ordered lists need three or more spaces indent to nest, unordered two or more to nest.
https://babelmark.github.io/?text=1.+A ++1.+A *+A +*+A 1.+A +++1.+A *+A ++*+A
https://astexplorer.net/#/gist/81dd323bf800689e8e5479cfa7b0ee8d/ec430603d07531397796e126061a8f80b3cb198c
The behavior is consistent across implementations and on github itself:
Remark does the same as the other implementations, see the clarification and examples above.
This is by design, it’s how markdown works, when markdown has less than the minimum indent for nesting lists, a single level list is created. This is documented in the commonmark specification at https://spec.commonmark.org/0.30/#example-310 and https://spec.commonmark.org/0.30/#example-311
To improve the developer experience, consider using https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-recommended#readme to highlight places where syntax may be confusing or misused.