benrbray / prosemirror-math

Schema and plugins for "first-class" math support in ProseMirror!
https://benrbray.com/prosemirror-math/
MIT License
249 stars 35 forks source link

KaTeX Math Source should be ignored by ProseMirror inputRules #2

Open benrbray opened 3 years ago

benrbray commented 3 years ago

Given a ProseMirror instance with both prosemirror-math and an input rule for automatically detecting *italic* text, type the following:

The two functions $f(n)=(5+n)*2$ and $g(n)=(n*2)+10$ are...

Since math source is currently represented as a text node, ProseMirror will scan the math source processing inputRules. In this example, it will recognize the substring *2$ and $g(n)=(n* as italic text and erase one of the math blocks.

Possible solutions: