Page MenuHomePhabricator

Update to MathJax 3
Open, LowPublic

Description

Mathoid currently uses MathJax version 2 to convert the LaTeX dialect texvc to standard HTML (nativeHTML) and SVG fallback images. Now, MathJax 3 dropped support standard HTML5, but introduced a new variant they call common HTML. However, it seems that the internal MathML representation is still available from the API.
The update will improve the experience for most users, which is a very strong argument to update. I could not figure out if the new CHTML mode works without javascript enabled in the client. I think it should, but I could not find the information.
Preliminary analysis:

  • verify that the page can be rendered without javascript
  • verify that there are no significant regressions for users using the native MathML rendering

Advantages

  • one-pass rendering. No external images
  • use upstream fixes

Disadvantages

  • Please add your points here.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 6 2019, 11:21 AM
Physikerwelt updated the task description. (Show Details)
Physikerwelt triaged this task as Low priority.Nov 6 2019, 11:49 AM
Physikerwelt updated the task description. (Show Details)Nov 6 2019, 12:31 PM

The deeper I investigate the situation, I get the impression that this update will be a big advancement. I can't see any disadvantages up to now.

Physikerwelt updated the task description. (Show Details)Nov 6 2019, 12:43 PM
Physikerwelt updated the task description. (Show Details)

I think the way to go forward is to introduce a new rendering mode and then phase out the current rendering mode. Otherwise regressions are too likely.

@Physikerwelt Thank you for creating this ticket, I think this change is long overdue. What are your thoughts regarding the implementation, in particular:

  • does the new rendering mode still need this restbase setup? I am just asking because getting rid of this would greatly reduce the complexity and dependencies, would make it much easier for people to contribute to the development of the math extension and install it on their own servers.
  • as far as I know the legacy rendering mode for mhchem package is no longer supported in mathjax 3.0. In my opinion this should not block the transition to the new rendering mode because this change is also long overdue, we just have to keep in mind that it will break some mhchem formulas. I can take care of this and make sure that they will get fixed.
  • the new rendering mode should conserve the original LaTeX input, i.e. not have something like texvcjs (T188879). The necessary syntax modfications are done (T197925), except for those that we could not extract from the database dumps. If we want to fix those pages we need the new rendering mode assigning error categories in real time.
  • we should take the new rendering mode as an opportunity to discuss getting rid of "default" rendering mode and making the "default" without parameters "inline" (textstyle).

Just a warning that accessibility has changed considerably in V3. I filed a MathJax issue that has some discussion about the inaccessibility of V3 out of the box. If the output is to be accessible, MathML needs to be hidden as was done in V2 and is currently done on wikipedia pages. In V3, the way to include MathML is described here. MathJax may change it's defaults in some configurations based on the inaccessibility as V3 currently exists; definitely check the output for hidden MathML if you switch to V3.