mentat-collective / MathLive.cljs

Clojurescript / React wrapper around the MathLive equation editor.
https://mathlive.mentat.org
MIT License
9 stars 2 forks source link

Remove Error noise from Clojure MathJSON representation when equation is valid #11

Open jefffriesen opened 1 year ago

jefffriesen commented 1 year ago

I started typing into a Mathfield and made a syntax mistake. Specifically, I didn't realize the parens autocompleted, so I wrote:

1+x+cos()y

Instead of

1+x+cos(y)

I went back and fixed it. But the Clojure representation included a lot of Errors in it even though rendered Tex looked fine. I refreshed the page, typed it in correctly the first time, and didn't get all of the Error cruft. See screenshots.

With initial error

Screenshot 2022-12-03 at 3 19 55 PM

Typed without errors

Screenshot 2022-12-03 at 3 22 19 PM
sritchie commented 1 year ago

Thank you for this! I filed a ticket with the mathlive repo (linked above), so we should reach paren-shifting nirvana soon. What we really need is paredit in the browser :)