Page MenuHomePhabricator

Row spacing `\\[20pt]` is invisible in client-side MathJax
Closed, ResolvedPublic2 Estimated Story Points

Description

BaseParsing::alignAt()/matrix() express a row's spacing as padding-bottom CSS on <mtd> (T380654), chosen because the native rowspacing MathML attribute isn't part of MathML Core and so is ignored by browsers' native MathML rendering. But MathJax's own SVG output computes table/delimiter geometry entirely from its internal metrics and ignores inline style — confirmed empirically: MathJax.mathml2svg() produces byte-identical SVG for padding-bottom: 6pt vs 200pt, but responds correctly to the native rowspacing attribute (5.0ex → 24.0ex for 0.5ex vs 20ex). This is why a cases/pmatrix brace looks correctly sized in Mathoid (server-side, MathJax-node) and native MathML, but wrong in client-side MathJax.

Event Timeline

Change #1343006 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] ext.math.mathjax: Restore rowspacing for MathJax

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

Physikerwelt renamed this task from Row spacing `\\[2pt]` is invisible in client-side MathJax to Row spacing `\\[20pt]` is invisible in client-side MathJax.Sep 18 2026, 7:49 AM
Physikerwelt triaged this task as High priority.
Physikerwelt set the point value for this task to 2.
Physikerwelt moved this task from Inbox to Code Review on the Math board.

Screenshot 2026-09-18 at 09.49.05.png (1,246×184 px, 27 KB)

^^ proposed fix

<math>\begin{aligned} a &= b \\[20pt] c &= d \end{aligned}</math>
BeforeAfter
Screenshot 2026-09-18 at 15.01.45.png (950×688 px, 65 KB)
Screenshot 2026-09-18 at 14.59.37.png (950×724 px, 66 KB)

Make sure that if "server-side SVG" and "client-side SVG" are rendered side by side, the appearance is the same. For some reason the two versions in your "after" screengrab seem to have different font sizes, so it's hard to tell.

Change #1343006 merged by jenkins-bot:

[mediawiki/extensions/Math@master] ext.math.mathjax: Restore rowspacing for MathJax

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