mdx-editor / editor

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

[BUG] Using directivesPlugin({ directiveDescriptors: [AdmonitionDirectiveDescriptor] }) captures to wildly #486

Closed pbjorklund closed 1 month ago

pbjorklund commented 1 month ago

Using admonitions plugin seems to match markdown strings like "1:a" (which means the first of) in Swedish.

Shouldn't it only trigger on ::: or at least using ::: on newline?

petyosi commented 1 month ago

:a is still a directive and is still recognized as such, text directive to be more precise. One possible solution for the visitor would be to somehow compile unmatched directives to their plaintext equivalent and insert a text node. You can give this a try and submit a PR.

pbjorklund commented 1 month ago

Solved it by simply not using it. Left an issue as ref for anyone else encountering since it took me a while to figure out what was happening. But seems like working as intended so will close.