Enable "Client side MathJax rendering" in Special:Preferences → Apperance → Math. Then preview a page with the contents <math>\textrm{foobar}</math>.
I expect to see "foobar" but instead I see "Math input error". Right clicking on the error and selecting "Show Math As MathML code" reveals a more detailed error message Unexpected text node "foobar".
The MathML code generated by MediaWiki is the following:
<math class="mwe-math-element" xmlns="http://www.w3.org/1998/Math/MathML"> <mrow data-mjx-texclass="ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow data-mjx-texclass="ORD"> <mtext> <mrow data-mjx-texclass="ORD">foobar</mrow> </mtext> </mrow> </mstyle> </mrow> </math>
Pasting this into https://mathjax.github.io/MathJax-demos-web/input-mml2svg.html reproduces the error message Unexpected text node "foobar".
Pasting the same into https://www-archive.mozilla.org/projects/mathml/demo/tester.html shows no errors in Firefox but does not render in Chrome.
Pasting the same into https://www.mathmlcentral.com/Tools/FromMathML.jsp shows an unexpected "mtext".
Pasting the same into https://validator.w3.org/nu/#textarea shows "Error: Element mrow not allowed as child of element mtext in this context."
All of these errors can be fixed by replacing line <mrow data-mjx-texclass="ORD">foobar</mrow> with just foobar.


