Page MenuHomePhabricator

Client side MathJax not applied when using Live Preview
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

image.png (1,589×248 px, 26 KB)

  • The SVG (client-side MathJax)from user preferences is used to render the second formula. The first use fourcemathmode=mathml i.e. server side SVG, and third uses forcemathmode=native i.e. Native MathML.
  • Edit the page in source edit mode.
  • Initial preview is fine.
  • Hit Show Preview button
  • First row is now

image.png (1,590×202 px, 25 KB)

  • Note that where the Client side MathJax SVG should render, only the native MathML is rendered.

What should have happened instead?:

Render as SVG using Client side MathJax.

Other information (browser name/version, screenshots, etc.):

Browser ecosia (Chromium).

Event Timeline

Looking at the generated html its producing just a MathML <math> tag.

Possible fixed by T433928 in next rollout.

I'd assume this is more a matter of "mathjax client side is not loaded on preview" (which I could see happening...). Almost by definition (it's a tiny bit more subtle than that), whatever happens around preview/after first save doesn't really (shouldn't really) depend on caching behaviours.

Maybe this is connected to T422077?

I'm reasonably sure it's connected to T419356 (as in: if I run window.MathJax.startup.defaultReady(); in my console on a preview, I get mathjax-client rendering) and there's reasons to believe that T422077 is T419356 as well. I thought it was a matter of missing the module, but it looks like it's a matter of triggering the rendering on the JS side.

Krinkle renamed this task from Clientside SVG rendering not used when previewing during an edit to Client side MathJax not applied when using Live Preview.Fri, Aug 14, 2:57 AM
Krinkle updated the task description. (Show Details)
Krinkle triaged this task as Medium priority.
Krinkle subscribed.

I've clarified the task that this is specific to Live Preview, as enabed via the "Show preview without reloading the page" preference.

This bug does not happen with the default preference, where Show Preview is a form submission with full reload, and thus MathJax renders an SVG the same way it would on a page view.

Change #1325581 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/Math@master] ext.math.mathjax: Call MathJax.typeset() from `wikipage.content` hook

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

Change #1325581 merged by jenkins-bot:

[mediawiki/extensions/Math@master] ext.math.mathjax: Call MathJax.typeset() from `wikipage.content` hook

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

Change #1326896 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/Math@wmf/1.47.0-wmf.16] ext.math.mathjax: Call MathJax.typeset() from `wikipage.content` hook

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

Change #1326897 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/Math@wmf/1.47.0-wmf.15] ext.math.mathjax: Call MathJax.typeset() from `wikipage.content` hook

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

Change #1326896 merged by jenkins-bot:

[mediawiki/extensions/Math@wmf/1.47.0-wmf.16] ext.math.mathjax: Call MathJax.typeset() from `wikipage.content` hook

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

Change #1326897 merged by jenkins-bot:

[mediawiki/extensions/Math@wmf/1.47.0-wmf.15] ext.math.mathjax: Call MathJax.typeset() from `wikipage.content` hook

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

Mentioned in SAL (#wikimedia-operations) [2026-08-18T20:48:29Z] <krinkle@deploy1003> Started scap sync-world: Backport for [[gerrit:1326896|ext.math.mathjax: Call MathJax.typeset() from wikipage.content hook (T434469 T419356 T422077)]], [[gerrit:1326897|ext.math.mathjax: Call MathJax.typeset() from wikipage.content hook (T434469 T419356 T422077)]]

Mentioned in SAL (#wikimedia-operations) [2026-08-18T20:50:32Z] <krinkle@deploy1003> krinkle: Backport for [[gerrit:1326896|ext.math.mathjax: Call MathJax.typeset() from wikipage.content hook (T434469 T419356 T422077)]], [[gerrit:1326897|ext.math.mathjax: Call MathJax.typeset() from wikipage.content hook (T434469 T419356 T422077)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-08-18T21:02:25Z] <krinkle@deploy1003> Finished scap sync-world: Backport for [[gerrit:1326896|ext.math.mathjax: Call MathJax.typeset() from wikipage.content hook (T434469 T419356 T422077)]], [[gerrit:1326897|ext.math.mathjax: Call MathJax.typeset() from wikipage.content hook (T434469 T419356 T422077)]] (duration: 13m 56s)