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

v4-beta.4 crashing unexpectedly #3120

Open
pkra opened this issue Oct 26, 2023 · 1 comment
Open

v4-beta.4 crashing unexpectedly #3120

pkra opened this issue Oct 26, 2023 · 1 comment
Labels
Accepted Issue has been reproduced by MathJax team Merged Merged into develop branch v4

Comments

@pkra
Copy link
Contributor

pkra commented Oct 26, 2023

Cf. Speech-Rule-Engine/speech-rule-engine#552

Using https://cdn.jsdelivr.net/npm/[email protected]/tex-mml-svg.js $\cdot \mathcal{O}_{\widetilde{X}}=\mathcal{L}\cdot \_{\widetilde{Z}}$ crashes -- it works fine in v4-beta.3.

In the browser, the error in the output reads a.childNodes[1] is undefined

@dpvc
Copy link
Member

dpvc commented Oct 27, 2023

It turns out that this is due to the \_ and can be caused by that macro alone. It comes from the new code that attaches the original LaTeX to the MathML elements they produce, and in particular to the code that is handling superscripts and subscripts from _ and ^.

@zorkow, can you look into this? It is happening at

https://github.com/mathjax/MathJax-src/blob/818f68e044c7fdf55e08abdb7042985d6385bc24/ts/input/tex/TexParser.ts#L579

I think the solution is to wrap the entire section

https://github.com/mathjax/MathJax-src/blob/818f68e044c7fdf55e08abdb7042985d6385bc24/ts/input/tex/TexParser.ts#L561-L588

that handles _ and ^ in

if (!node.isToken) {
...
}

but since I'm not all that familiar with how the LaTeX processing is done, I'd like to hear your advice on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Merged Merged into develop branch v4
Projects
None yet
Development

No branches or pull requests

2 participants