-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
mml3 still not work in MathJax3.2 #2718
Comments
Try adding mml: {
forceReparse: true
}, to your configuration. |
Like this?
It doesn't work either. Even mathml that doesn't have mlongdiv throws error "MathML must consist of a single element". I've updated the code example |
I saw the code mathml compile function, debugged my code example. Here is why the error was thrown. The code here want to check if there is only a single |
BTW, a spelling mistake here: ts/core/OutputJax.ts#L223 |
Something wrong here. During executeFilters, the |
Thanks for trying to diagnose the problem. It turns out that your example page works in Firefox, where I was doing my testing, but not in Chrome or Safari, so it seems that WebKit (and Blink) treat the transform differently, and extra line breaks seem to be inserted, as you point out. For now, you can add an additional preFilter that removes those line breaks before the MathML is parsed. Add startup: {
ready() {
MathJax.startup.defaultReady();
MathJax.startup.document.inputJax[0].preFilters.add(function (data) {
data.data = data.data.replace(/[\s\n]+<math/, '<math')
.replace(/math>[\n\s]+/, 'math>');
}, 10);
}
} to make it window.MathJax = {
startup: {
ready() {
MathJax.startup.defaultReady();
MathJax.startup.document.inputJax[0].preFilters.add(function (data) {
data.data = data.data.replace(/[\s\n]+<math/, '<math')
.replace(/math>[\n\s]+/, 'math>');
}, 10);
}
},
options: {
renderActions: {
addMenu: [0, '', '']
}
},
chtml: {
matchFontHeight: false,
adaptiveCSS: false
},
loader: {
load: ['input/asciimath', '[mml]/mml3']
},
mml: {
forceReparse: true
}
}; to your configuration and that should resolve the issue. Note, however, that the XSLT is not set up to deal with your <math xmlns="http://www.w3.org/1998/Math/MathML">
<mlongdiv charalign="center" charspacing="0px" stackalign="left">
<mn>48</mn>
<mrow/>
<mn>□52</mn>
</mlongdiv>
</math> for better results. |
Depending on the business scenario, I'll see if it's necessary to pre parse before calling mathjax, or use mathjax2. Thank you for your reply. I hope mathjax will be better and better. |
Move mml3 filter to an mmlFilter so that forceReparse isn't needed. (mathjax/MathJax#2718)
Issue Summary
Follow the experimental mml3 extension, I add the loader in my MathJax configuration. Then in page, the mml3.js is loaded, but the
mathml
usingmlongdiv
is not rendered correctly.Steps to Reproduce:
mml3.js
file is successful.Technical details:
Supporting information:
The text was updated successfully, but these errors were encountered: