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

[BUG] Numbered list with sub-list shows wrong numbers #515

Open
2 tasks done
shaipetel opened this issue Jun 27, 2024 · 1 comment
Open
2 tasks done

[BUG] Numbered list with sub-list shows wrong numbers #515

shaipetel opened this issue Jun 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shaipetel
Copy link

If you want to ask for support or request features, sponsor the project and contact me over email.

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
If you have the following numbered list, with a sub list:

1. one
   1. sub 1
   2. sub 2
2. two
3. three

once you go to view source and back to rich text mode, or if you load the editor with this markdown as the current value - the numbered list after the sub list will be wrong, showing 3 instead of 2

Reproduction
https://codesandbox.io/p/sandbox/mdx-editor-base-forked-vksdyj?file=%2Fsrc%2FApp.tsx

To Reproduce
Steps to reproduce the behavior:

  1. add the above markdown
  2. switch to source and back to rich text
  3. bullet 2 is now 3

Expected behavior
After a sub-list, bullets should continue normal numbering

Screenshots
On load, or after edit:
image

After switching to source and back:
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser Edge

Additional context
This happens every time after a nested sub list, the next number on the higher level will jump to the next.

@shaipetel shaipetel added the bug Something isn't working label Jun 27, 2024
@petyosi
Copy link
Contributor

petyosi commented Jul 2, 2024

I can confirm that this is bug; the weird thing is that it works initially, as there is no difference in the HTML after the toggle. There's probably a CSS-only solution that puts content into the markers or uses before for that purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants