# How acceptable is prosemirror-math as an editor style for this site?

This is a follow-up to one of the possible answers raised in the thread The proposed changes to the text editor would break this site.

Prosemirror-math is a math editing framework that allows for direct editing of a rich-text preview. The mathematics is automatically rendered, and it is converted into LaTeX source when it is selected.

(One of the aspects that came up last time is that the default back-end is not MathJax but KaTeX. This will apparently be expanded in future, so the two decisions will become decoupled.)

Anyways, the new development is that a working demonstration version of this editor is now available, which is now ready to play around with. So $$-$$ what do we think? Is it usable? Does it work to produce complex answers?

• (KaTeX is not a typo.) Mar 30 '21 at 15:21

I tried it for a few minutes in Safari on iPad and in Edge on PC and it seemed to work well. In addition to trying hand-editing, I pasted in a few reasonably complicated equations from my existing answers and they rendered properly.

I miss being able to preview while I type, but if I had to use this editor I would not leave PSE. It’s nice to have \ket, etc.

At the time this question was asked, the editor was completely unusable on the four different platforms I tried. A day later, the specific issues I describe seem to have been resolved, which suggests the developer is responsive to issues. However it also suggests that this tool needs a much larger test community than it currently has. Enabling this editor so that authors on Physics would be part of the test community for prosemirror would make the experience of writing on Physics very different.

To emphasize that I can no longer reproduce these problems, I’ve hidden them behind spoiler tags.

On Safari for iOS and for desktop, the editable part of the page never loads at all. The page ends with "The text below this line is all editable, including the math! Go ahead, try it!" and a change in background color. [On desktop (14.0.3), the developer console says the definition const REGEX_INLINE_MATH_DOLLARS_ESCAPED = /(?<!\\)\\\$(.+)(?<!\\)\\\$/; is an "invalid regular expression: invalid group specifier name." Pasting the regex from the developer console into this edit box seems to double some backslashes, and from Markdown to display seems to double some more; there are several layers of special characters here.]

On today's Firefox (87.0) for MacOS, the editable part of the page does load. Moving the cursor in and out of math-mode sections causes the display changes in the animation, and editing those things does what you might expect. However the Enter key is broken and doesn't create new lines. This makes it also impossible to write any multi-paragraph text, or (so far as I can tell) to start a new line with  and create displaystyle mathematics. [This behavior seems to be fixed after a comment from the author below.]

Using Firefox (87.0.0-rc.1) on Android, I get a strange behavior when I try to add text to the beginning of the editable area: I put the cursor in one place, start typing, and the cursor jumps to a different wrong place and the new text appears there instead.

• github.com/benrbray/prosemirror-math/issues/11 seems to be the place to report bugs with the interactions with Safari. Mar 29 '21 at 15:01
• (... though let's take it easy with the developer - he's not responsible for the huge pressure that SE seems to want to put him under.) Mar 29 '21 at 15:04
• Author here, thanks for your feedback! It turns out the demo page was configured incorrectly, I just pushed a fix for the enter key bug. As for the Safari bug, I don't own a Mac to test on, so any details you can provide (especially output from the developer console) would be immensely helpful. Mar 29 '21 at 15:49
• @BenjaminBray, welcome to Physics! I updated my post, but I don't have very much bandwidth for testing. I hope your project is successful.
– rob Mod
Mar 29 '21 at 16:23
• Using the same version of Firefox on Android, I'm not able to reproduce that strange behavior rob mentions. Regarding Safari, I can only confirm the answer by G. Smith: on IpadOS the editable part loads fine and seems to work well.
– Urb
Mar 30 '21 at 10:00
• @Urb Same here. Answer updated
– rob Mod
Mar 30 '21 at 13:10