mdx-editor / editor

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

[BUG] when a content has '{}' chars,editor appears errors with jsxPlugin. #470

Closed samuelhsin closed 1 month ago

samuelhsin commented 1 month ago

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

Describe the bug hen a content has '{}' chars,editor appears errors with jsxPlugin.

The source code is below: 1 2 3 4
{"a":"test"} {"a":"test"} 1234 1234

and rich mode appears parsing expression errors.

Error parsing markdown: Could not parse expression with acorn. You can fix the errors in source mode and switch to rich text mode when you are ready.

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

Desktop (please complete the following information):

petyosi commented 1 month ago

That's expected I believe. These are treated as JSX expressions.

samuelhsin commented 1 month ago

I comment the code:

 [addSyntaxExtension$]: mdxjs(),

and works.