mdx-editor / mdx-editor/editor
[BUG] incorrect escaping on decorators
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
When typing : followed by text, the : being escaped, in order for the editor to not parse it as directive node (expected behavior). however when adding more semicolons its not escaping on any even occurrence.
Reproduction
- Go to Live Preview
- Type:
:A:B:C:D - Check the output MD. result will be
\:A:B\:C:D
Expected behavior
Either editor should escape every : (and not just even) or it should not parse it as directive. currently those even occurrences which not being escaped does parsed to be mdsat directive nodes, then the MdastDirectievVisitor does not recognize then, because they not exist in registered directive descriptors, and as a result The content from there on not displayed, and the editor not emitting any change updates
Screenshots
editor mode:
source mode:
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
Reproduce the issue in the linked Live Preview using :A:B:C:D and compare the editor and source output. Trace how repeated colons are escaped and how unregistered directive nodes affect subsequent content and change updates; done means the behavior matches one of the stated expected outcomes without dropping content or updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100