MathJax
MathJax copied to clipboard
MathMLVisitor should turn <texatom> into <mrow>
tex = '{1}';
options = {end:MathJax._.core.MathItem.STATE.CONVERT,format:"TeX"};
root = MathJax.startup.document.convert(tex,options);
visitor = new MathJax._.core.MmlTree.MathMLVisitor.MathMLVisitor();
console.log(visitor.visitTree(root,document).outerHTML);
Output
<math display="block"><texatom><mn>1</mn></texatom></math>
I notice that when SerializedMmlVisitor visits a TeXAtom node, it is turned into a mrow with the appropriate TeX class indicator. But MathMLVisitor doesn't do this conversion.
The MathML visitor isn't used in MathJax anywhere, so it doesn't get much attention. You are right, though, it should do a better job with TeXAtom nodes. I'll see what I can do.
I've made a PR that resolves the issue (by refactoring the SerializedMmlVisitor code so that can be used by MathMLVisitor as well).