-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Additional text after nested list is not correctly indented if I use 4 spaces #5671
Comments
The behavior is fully consistent with the CommonMark spec. You should have tested on the MDX playground. At worst this is an MDX bug, not a Docusaurus one. |
There is a tutorial playground at commonmark: https://commonmark.org/help/tutorial/10-nestedLists.html And this is the generated HTML: <h1>Hello, world!</h1>
<ul>
<li>
<p>list 1</p>
<ul>
<li>list 1-1</li>
</ul>
<p>paragraph with wrong indentation</p>
</li>
<li>
<p>list 2</p>
<ul>
<li>list 2-1</li>
</ul>
<p>paragraph with correct indentation</p>
</li>
<li>
<p>list 3</p>
<ul>
<li>list 3-1</li>
</ul>
<p>paragraph with correct indentation</p>
</li>
<li>
<p>list 4</p>
<p>paragraph with correct indentation</p>
</li>
</ul> So, if I understand correctly: since the behaviour is not consistent with that of commonmark, this is then an MDX bug...? |
Hah, could be related to #3018 then :D Actually, seems it's been fixed in the latest MDX version as well: https://mdxjs.com/playground/ So let's just hope that Docusaurus can upgrade its MDX version soon |
You're right. On https://mdxjs.com/playground/, this is the output: Sorry and thanks for the pointers. I'm not that well-versed and up-to-date on these issues :) Shall we leave this issue open, or close it? |
That's right, it's MDX v1 issue, and we can't fix it until to upgrade to MDX v2 which is currently not production-ready. Closing in favor of #4029. |
🐛 Bug Report
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
If I use 4 spaces to indent my list, then additional text after a nested list is not correctly indented. If I use 2 spaces, then it is indented correctly. If there is no nested list item, then the indentation is correct even if I use 4 spaces.
Have you read the Contributing Guidelines on issues?
Yes.
Steps to reproduce
Initialize a new docusaurus website
Modify docs/intro.md, add the following at the top:
Expected behavior
If I use 4 spaces to indent the additional paragraph, it is indented correctly (same level as the top level list).
Actual behavior
The paragraph is indented at the same level as the nested list.
Your environment
Reproducible demo
I cannot use https://new.docusaurus.io to create a reproducible demo, because the indentations are automatically converted to 2 spaces when I save.
Here is the repo I have set up to reproduce this bug: https://github.com/wpyoga/docusaurus-nested-indent-problem
The text was updated successfully, but these errors were encountered: