mdx-editor / mdx-editor/editor

[BUG] incorrect escaping on decorators

Open
#711 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

  1. Go to Live Preview
  2. Type: :A:B:C:D
  3. 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:
Image
source mode:
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.