mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.57k stars 124 forks source link

[BUG] plain text with colon causes parsing error #509

Closed johnxu16 closed 2 weeks ago

johnxu16 commented 2 weeks ago

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

Describe the bug colon has to be escaped

Ex. ❌ "foo:bar" ✅ "foo\:bar"

Reproduction Start from https://codesandbox.io/p/sandbox/mdx-editor-base-q8s7zr?file=/src/App.tsx to reproduce the problem so that I can observe the issue on my side and make sure that the fix reliably addresses it.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://mdxeditor.dev/editor/demo
  2. Click into source mode
  3. Input text "foo:bar"
  4. Toggle back to rich-text mode
  5. See error

Expected behavior foo:bar rendered as plain text

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context

petyosi commented 2 weeks ago

That's treated as a markdown directive. If you're not going to use those, just disable the plugin.