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

Test in Safari #11

Open benrbray opened 3 years ago

benrbray commented 3 years ago

ProseMirror (and by extension, prosemirror-math) relies on contenteditable to function. Since the implementation of contenteditable is not yet standardized between browsers, we must test manually in each browser to ensure acceptable behavior.

I do not own a Mac, so I cannot test prosemirror-math on Safari. Please report any bugs you find in Safari!

benrbray commented 3 years ago

In the meantime, it looks like I can use the webkit-based Epiphany browser as an approximation to Safari. However, the developer tools are lacking (even console.log is unsupported).

gzuidhof commented 3 years ago

This package currently doesn't work in Safari, I just gave it a try. A prosemirror editor won't be created at all as a regex literal is invalid:

SyntaxError: Invalid regular expression: invalid group specifier name

The issue appears to be lack of negative lookahead support (which surely is also an issue in not-that-old browsers).

Perhaps we can try-catch that part and print a warning to the console in case it is not supported? These browsers would then only be able to enter math editing mode by pressing a button or something which seems acceptable for now. A more long-term fix would be to implement one of these approaches.


As for not owning a Mac, I have used Browserstack in the past for testing on a range of (very) old devices and browsers. You can get a free account through their generous free Open Source offering (https://www.browserstack.com/open-source). I got approved pretty quickly, perhaps this could be useful for your open source work :)

benrbray commented 3 years ago

Thanks for trying it out in Safari. Are you using the most up-to-date version? Is the issue present on the demo page? Based on some user feedback, I already attempted to fix the unsupported regex issue, but if it's still a problem I'll take another look.

~I'll also look into BrowserStack, thanks for the suggestion!~ (I was insta-approved for BrowserStack, and confirmed that the demo page works on the latest version of Safari)

gzuidhof commented 3 years ago

You're right, sorry about the false alarm :(. I naively opened Starboard's homepage, but I didn't actually push Starboard's latest version to there. You can close this ticket!