Page MenuHomePhabricator

<math>\hat{}</math> generates invalid MathML
Closed, ResolvedPublicBUG REPORT

Description

Enable "MathML (experimental; no images)" in Special:Preferences → Apperance → Math. Then preview a page with the contents <math>\hat{}</math>. This generates the following MathML: <mover><mo>^</mo></mover>.

"Invalid markup: Incorrect number of children for <mover/> tag." is printed to the Firefox console.

The same problem happens with the macros acute, grave, ddot, tilde, bar, breve, check, hat, vec, dot, widetilde, widehat, overrightarrow, overline, underline, overarc, overbrace, underbrace, overrightarrow, overleftrightarrow, overset{}, underset{} (and possibly more). These macros are usually not used with an empty argument {}, but sometimes you want to talk about the symbols themselves as in "the hat symbol <math>\hat{}</math>" (see the 12 enwiki articles and the 11 dewiki articles where one of the above macros is used with empty argument).

Details

Event Timeline

Physikerwelt triaged this task as Medium priority.
Physikerwelt moved this task from Inbox to Ready to implement on the Math board.

This applies to all 16 instances for the accent callback group

Screenshot 2025-09-10 at 19.52.11.png (528×868 px, 32 KB)

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

[mediawiki/extensions/Math@master] Fix accent rendering for empty args

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

Change #1187060 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Fix accent rendering for empty args

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