Page MenuHomePhabricator

MathJax does not work on MobileFrontend
Closed, DeclinedPublic

Description

If you turn on MathJax rendering in the standard MediaWiki options (e.g., for English Wikipedia, go to your appearance preferences and select "Client-side MathJax" under "Math"), viewing pages on mobile using the MobileFrontend displays math in pages as the raw LaTex-style math markup (e.g., $ L=D-A, $), not as a rendered mathematical statement.

Selecting other math rendering options (e.g., "MathML with SVG or PNG") works as expected on mobile, and renders the mathematical symbols.

It seems like selecting MathJax as a rendering option disables server-side math rendering, but MobileFrontend does not include MathJax.

Event Timeline

int3h raised the priority of this task from to Needs Triage.
int3h updated the task description. (Show Details)
int3h added a project: MobileFrontend.
int3h subscribed.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This is an issue in the MathJax extension. If you find a maintainer of it I'll be able to help out.

This is an issue in the MathJax extension. If you find a maintainer of it I'll be able to help out.

Do you mean the MathJax or the Math extension. I do not know if the mathjax resource modules (and there are quite a few) have been disabled by mobile frontend on purpose. If all the of the provided MathJax data would be downloaded that might be bad for low Budget data plans. I.e. since a WMF specific Version of MathJax 2.3 is used. See also T78046

I meant MathJax sorry. Where should Mathjax bugs get filed? Mathjax will need to test itself out in the mobile skin (many client side code are incompatible) and then explicitly turn itself on by updating its ResourceLoader modules. Who can I talk to about that?

I would say that if MathJax is not supported on mobile (it's a beast, we better not load it), we should ignore the user selected preference and fall back to another setting, that is supported.

So that means, use MathML with SVG or PNG images.

I would say that if MathJax is not supported on mobile (it's a beast, we better not load it), we should ignore the user selected preference and fall back to another setting, that is supported.

So that means, use MathML with SVG or PNG images.

+1

This bug keeps coming up so I'd be super happy to resolve this in some satisfactory way once and for all. Alas I've never had the time to look into this extension. What do you need from MobileFrontend to do this? You can use Output::getTarget to determine whether you are on mobile or not. Please raise some specific sub tasks for any MobileFrontend changes you'll need to do this.

I can implement the change suggested by TheDJ it's probably two or three lines of code

Is parser output vary'ied per target ? otherwise it might be a bit difficult to override the user's preferences.

Change 203857 had a related patch set uploaded (by Physikerwelt):
WIP: Do not submit

https://gerrit.wikimedia.org/r/203857

setTarget / getTarget can be found on OutputPage not ParserOutput

Change 203857 abandoned by Physikerwelt:
WIP: Do not submit

Reason:
This approach does not work. More work is needed to bypass caching issues

https://gerrit.wikimedia.org/r/203857

MathJax will be removed T99369