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.beta4] unexpected TeX parser crash (regression from beta3) #3217

Closed
pkra opened this issue Apr 10, 2024 · 4 comments
Closed

[v4.beta4] unexpected TeX parser crash (regression from beta3) #3217

pkra opened this issue Apr 10, 2024 · 4 comments

Comments

@pkra
Copy link
Contributor

pkra commented Apr 10, 2024

The following crashes the TeX parser.

F_{11} \coloneq \mathrm{Hensel\_qf\_unimodular}(F_{11}, p^{-i_1} G_1, p^{-i_1} Z_{11}', a,b)

This appears to be a regression from v4.beta3.

Minimal example: \mathrm{a\_b}.

/node_modules/mathjax-full/mjs/input/tex/TexParser.js:328
                node.childNodes[1].attributes.set(TexConstant.Attr.LATEX, str);
                                   ^

TypeError: Cannot read properties of undefined (reading 'attributes')
    at TexParser.updateResult (/node_modules/mathjax-full/mjs/input/tex/TexParser.js:328:36)
    at TexParser.parse (/node_modules/mathjax-full/mjs/input/tex/TexParser.js:51:14)
    at TexParser.Parse (/node_modules/mathjax-full/mjs/input/tex/TexParser.js:74:18)
    at new TexParser (/node_modules/mathjax-full/mjs/input/tex/TexParser.js:27:14)
    at BaseMethods.MathFont (/node_modules/mathjax-full/mjs/input/tex/base/BaseMethods.js:165:15)
    at CommandMap.parse (/node_modules/mathjax-full/mjs/input/tex/TokenMap.js:108:22)
    at SubHandler.parse (/node_modules/mathjax-full/mjs/input/tex/MapHandler.js:33:32)
    at TexParser.parse (/node_modules/mathjax-full/mjs/input/tex/TexParser.js:50:60)
    at controlSequence (/node_modules/mathjax-full/mjs/input/tex/ParseMethods.js:45:16)
    at RegExpMap.parse (/node_modules/mathjax-full/mjs/input/tex/TokenMap.js:21:49)

Node.js v21.7.1
@pkra
Copy link
Contributor Author

pkra commented Apr 10, 2024

mathop runs into the same problem, it seems. But \text{} (and plain _) seems to workaround it at least.

@dpvc
Copy link
Member

dpvc commented Apr 10, 2024

This is a duplicate of #3120 where you reported that earlier. It is the \_, as you have noted, and is fixed in #1028.

@pkra
Copy link
Contributor Author

pkra commented Apr 10, 2024

Ah, sorry for the noise 😞

@pkra pkra closed this as completed Apr 10, 2024
@dpvc
Copy link
Member

dpvc commented Apr 10, 2024

No problem.

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