Page MenuHomePhabricator

\overbrace rendered below (not above) in MathML and client-side Mathjax
Closed, ResolvedPublicBUG REPORT

Description

Enable "MathML (experimental; no images)" or "Client side MathJax rendering" in Special:Preferences → Apperance → Math. Then preview a page with the contents <math>\overbrace x</math>.
I expect to see a curly brace above x like this:

⏞
 x

but it's actually the other way around:

 x
⏞

For a real-world example, see this figure.

Event Timeline

The macros overarc, overline, overrightarrow, overleftarrow, overleftrightarrow are also affected by this bug.

The issue is that the PHP function underOver decides between above and below using $name[0] but $name is \overbrace with a backslash.

Physikerwelt added subscribers: Andreg-p, Physikerwelt.

Thanks for reporting. That's an obvious bug. @Andreg-p and I recently changed the internal treatment of macros to include the \ in the macro names.

The respective code checks if the macro name has the letter 'o' at position 0. Now, this is position 1; thus, it does not work. We could now change it from 0 -> 1 to fix the problem. However, I would rather define an explicit list of which macros generate over and which generate under.

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

[mediawiki/extensions/Math@master] Fix rendering of underOver

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

Change #1104157 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Fix rendering of underOver

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

Screenshot 2024-12-16 at 16.58.30.png (326×2 px, 85 KB)

Works now on beta; deployment to other wikis will happen Thursday. Unfortunately, affected pages need to be pruned with action=purge

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

[mediawiki/extensions/Math@REL1_43] Fix rendering of underOver

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

Change #1105075 merged by jenkins-bot:

[mediawiki/extensions/Math@REL1_43] Fix rendering of underOver

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