mdx-editor / mdx-editor/editor
[BUG] Code block not getting inserted inside list items
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 307
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 5
Description
Describe the bug
When inserting a code block within a numbered list in the MDX Editor, the code block is placed outside the list instead of being properly nested. This breaks the list numbering continuity.
Reproduction
Reproducible in the default editor environment with code block and lists plugins
To Reproduce
- Create a numbered list
- Place cursor at the end of a list item, suppose 2nd list item
- Click the "Insert code block" button
- Observe incorrect behavior : the list item breaks the list ordering and does not gets inserted in the list. The list items 2 resets to
###Expected Behavior
The code block should get inserted in list item 2 and the list item should continue
Actual behavior
- Code block appears outside list
- List numbering restarts
- List structure breaks
Additional context
The issue appears related to:
- Missing indentation (needs 4 spaces/tab for nested code blocks)
- Improper list continuation handling after code blocks
Screenshots
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the default editor environment with the code block and lists plugins, reproduce the issue by inserting a code block in the second numbered list item, and trace the insertion behavior. Done means the code block remains nested in the list item and subsequent list numbering continues without restarting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100