-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: Upgraded Mathjax version from 2.7 to 3.0.1 #32418
Conversation
Thanks for the pull request, @Yagnesh1998! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
Updated with a merge commit. |
@Yagnesh1998 looks like there are test failures, can you have a look. |
@e0d can u please help what is failure? |
You will need to look at the log of the failing unit test and figure out why the change is causing it. You can see the logs by clicking on the details link. I'm going to update the branch, but the failures are almost certainly caused by the upgrade. |
@Yagnesh1998 The failures seems to be related to differences in MathJax configuration. See this: |
This is on my queue to review, but one thing off the bat: MathJax upgrades must not be taken lightly. There is a lot of content across organizations that uses it, and the relevant stakeholders have to be brought into this so they can check for regressions. (There have been issues with MathJax upgrades in the past.) With that in mind, ideally we'd find a way for content owners to roll this out incrementally. Maybe via course waffle flag to enable MathJax 3? |
Hi @Yagnesh1998! Just following up on this :) |
The current supported version of MathJax is 3.2.2. https://www.mathjax.org/ As noted above, the configuration is different between v2.x and v3.x. The platform currently uses a mix of v.2.x and v3.x (v3.x in Discussions, for example). There is a known shortcoming with v.3.x related to lack of support for line breaks (or automatic wrapping, or both). mathjax/MathJax#2312 The interactivity (particularly accessibility features) of v3 is quite a bit different than v3, so users who rely on accessibility features may consider an automatic upgrade disruptive. More specifically, institutions that host courses that include MathML, and who provide accessibility documentation of their own, may find that their docs are obsolete. In the last year or so, Firefox and Chrome have added support for native rendering of MathML (though I'm not sure about details re expected formats). If the browser supports minimal rendering of MathML, it's conceivable that different users having more specific accessibility UI preferences might be able to use their preferred solutions through browser extensions instead of integration in the platform. A long-term solution that doesn't involve pushing JS packages for MathML rendering might also save a lot of $ in data traffic. There's another accessibility solution for MathML, called MathCAT. https://nsoiffer.github.io/MathCAT/ What I'd like to see in Open edX learning experience MFE and supported xBlocks:
This way, course authors can confirm layout compatibility with their MathML content (something we can't do in an automated way), and can also also toggle accessibility solutions if a learner has a specific preference. For the rest of the platform, I think upgrading to MathJax v3.x (last supported) is safe for now. |
Possibly of interest: Force MathJax/KaTeX/MediaWiki to use native MathML rendering. https://chrome.google.com/webstore/detail/native-mathml/lcadkfljmcmcflpdbfmgcpjlejmpcplg Related to addition of MathML rendering support in Chrome: I see that for native rendering, Chrome is looking for syntax, so there would be some updating needed in Open edX docs, and also some compatibility checking and/or adjustment with math authoring solutions used in TinyMCE throughout the platform. Open edX expects authors to use MathType authoring plugin for TinyMCE is another possible accessible authoring solution: https://docs.wiris.com/mathtype/en/mathtype-integrations/mathtype-for-html-editors/mathtype-for-tinymce.html https://www.npmjs.com/package/@wiris/mathtype-tinymce6 Not mentioning edX though: https://www.wiris.com/en/mathtype/mathtype-for-lms/ |
Sample pages for testing rendering: https://developer.mozilla.org/en-US/docs/Web/MathML/Examples |
One more thought: I'm told that MathJax isn't working in some countries such as China, due to certain content servers being blocked. If we're going to update configuration, it might be a good time to move the source files to a self-managed server to resolve this issue. |
Hi @Yagnesh1998! Flagging the above comments for you. Please let us know if you plan to pursue this pull request. Thanks! |
Seconding @wittjeff's comment above: I don't think we'll be able to straight-up upgrade Mathjax to v3. At the very least we'll need to retain the current (v2) behavior as a default during a deprecation window, while giving the option to turn on the new one. And in an ideal world we'd give authors the option to pick, as Jeff describes. |
I am very sorry for the very late replay @mphilbrick211 & @wittjeff |
@wittjeff & @arbrandes |
Hi @wittjeff and @arbrandes - just flagging this for follow-up. |
I have created a PR: #33555 for the full upgrade. Apologies for missing this PR but it seems to be incomplete, still I should have probably continued the work here instead of starting fresh. |
@Yagnesh1998 Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
@navinkarkera I close this PR and we will continue on #33555 |
More notes just to be thorough:
|
Description:
fix: Upgraded Mathjax version from 2.7 to 3.0.1
OpenEdx is using Mathjax 2.7 version in the current version which is less accessible this drives us to upgrade it to the new latest version of Mathjax (3.0.1) which is having more support for accessible people.
Example:
Old (2.7): when we tab to the equation, it doesn't speak.
New (3.0.1) when we tab to the equation, it starts to speak the equation nicely.
Testing instructions: