class='MJX-TeXAtom-ORD' in MathML crashes mathml2chtml
Created by: NSoiffer
Issue Summary
If class='MJX-TeXAtom-ORD'
is present in MathML being converted by mathml2chtml
, then the function crashes. This happens in both Firefox and Chrome
Steps to Reproduce:
- Open https://mathjax.github.io/MathJax-demos-web/input-mml2chtml.html
- Paste the following MathML into the input area:
<math display='block' id='Mna33kyx-0'>
<mn class='MJX-TeXAtom-ORD' id='Mna33kyx-9'>2</mn>
</math>
- Click Render and open the debugger to see the message:
Uncaught Error: Unexpected text node "2"
at t.error (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:205225)
at t.addText (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:204033)
at t.addChildren (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:203371)
at t.makeNode (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:202222)
at t.addChildren (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:203503)
at t.makeNode (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:202222)
at t.addChildren (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:203503)
at t.makeNode (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:202222)
at t.addChildren (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:203503)
at t.makeNode (cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js:1:202222)
I know it might seem strange to have this internal class set, but the situation is that the math is being grabbed from the web, processed a little, and being sent back to MathJax for rendering. Since the original source (Wikipedia) used MathJax, that shows up.
Technical details:
- MathJax V3.2.0