Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AsciiMath work with Vite #3122

Open
DanielJGeiger opened this issue Oct 29, 2023 · 1 comment
Open

Make AsciiMath work with Vite #3122

DanielJGeiger opened this issue Oct 29, 2023 · 1 comment

Comments

@DanielJGeiger
Copy link

Issue Summary

Vite uses strict mode, so the usage of arguments.callee fails. Besides removing arguments.callee from the relevant JS files, Vite compatibility evidently requires slight changes to an additional AsciiMath JS file.

Steps to Reproduce:

See https://excalidraw-mcjzus0ve-excalidraw.vercel.app/ (source commit excalidraw/excalidraw@27a8cda) for an example of mathjax/MathJax-src#854 in use. In this deployment:

  1. Select "Math" in the toolbar.
  2. Type \(\alpha\) and press "Escape".
  3. Rendering fails with the browser console error "ReferenceError: MathJax is not defined", traced back to an AsciiMath JS file.

Technical Details:

  • MathJax Version: 3.2.2/4.0.0-beta.3
  • Client OS: Linux
  • Browser: Multiple

I am configuring and loading MathJax via loadMathJax() in src/element/subtypes/mathjax/implementation.tsx.

Supporting Information:

@dpvc
Copy link
Member

dpvc commented Oct 31, 2023

Currently, as you can see, the AsciiMath input jax has not been ported to a native v3 input jax, but instead loads the legacy v2 code and patches it in through some hacked shim code. The AsciiMath code needs to be ported to an actual v3 input jax so that the legacy v2 code can be dropped. This is one of the last remaining v2 pieces that needs to be moved to v3.

We are not planning to make changes to the legacy v2 code at this time, but appreciate the effort you have put into providing the changes you have made. I'm sure that will be useful to others who are having similar issues to yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants