mdx-editor / mdx-editor/editor
[BUG] Implicit self closing HTML tags (e.g. <br>) are unsupported by the editor
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 307
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 5
Description
- 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
Implicit self-closing HTML tags like <img> and <br> fail to load in the MDX editor as they 'have an unmatched closing tag'.
Reproduction
Repro sandbox
To Reproduce
Steps to reproduce the behavior:
- First editor fails to load
Expected behavior
renders as a linebreak as supported in most flavours of markdown
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: any
Additional context
HTML tags appear to be parsed with the JSX parser, which is expecting a self-closing tag marker or an end tag (to be valid JSX syntax)
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 with the linked reproduction sandbox and inspect /src/App.tsx to reproduce the failure in the first editor. Trace how implicit tags such as
and are parsed, then verify that the editor loads them and that
renders as a line break.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100