When the accessibility explorer is activated, MathML line break, <mspace linebreak="newline" />
, won't work.
Steps to Reproduce:
explorer
property to false
and true
.When explorer
is set to false there will be a line break which is what I want but I also want the accessibility feature.
I found a workaround here, https://github.com/mathjax/MathJax/issues/2496#issuecomment-675626155.
The issue turns out to be in the a11y extension that handles the collapsible elements in the math. When the collapsing is in the content for the top-level element, the MathML tree is not rebuilt quite right, and that disables the line-breaking. I have made a fix in the a11y repository, and it will be included in the next release of v2. In the meantime, you can use
<script type="text/x-mathjax-config"> (function () { var V = MathJax.version.split(/\./); if (V[0] === "2" && (parseInt(V[1]) < 7 || (V[1] === "7" && parseInt(V[2]) <= 8))) { MathJax.Hub.Register.StartupHook("Collapsible Ready", function () { var Collapsible = MathJax.Extension.collapsible; Collapsible._MakeAction = Collapsible.MakeAction; Collapsible.MakeAction = function (collapse, mml) { if (mml.type !== 'math') return this._MakeAction(collapse, mml); var mrow = mml.data[0]; mml.data = mrow.data; mrow.data = []; var maction = this._MakeAction(collapse, mml); mrow.data = mml.data; mml.data = [mrow]; return maction; }; }); } })(); </script>
just before the script that loads MathJax.js itself in order to fix the issue until the new version is available. This checks the version number, so the patch will only affect version 2.7.8 and below.