Page MenuHomePhabricator

Section anchor depends on the rendering mode
Open, MediumPublic

Description

In fr:Circuit de Sawyer-Tower, a section title contains a <math> tag and the section anchor depends on the rendering mode:

  • Le_cycle_d.27hyst.C3.A9r.C3.A9sis in PNG mode;
  • Le_cycle_d.27hyst.C3.A9r.C3.A9sis_.24_P.28E.29_.24 in TeX and MathJax modes;
  • Le_cycle_d.27hyst.C3.A9r.C3.A9sis_.0A.0A_.0A_P.0A_.28.0A_E.0A_.29 in MathML mode.

This may break links between articles for people changing the rendering mode.

Event Timeline

Ltrlg raised the priority of this task from to Needs Triage.
Ltrlg updated the task description. (Show Details)
Ltrlg added a project: Math.
Ltrlg added subscribers: Ltrlg, Aklapper.

The code responsible for this is at function
formatHeadings at core/includes/parser/Parser.php

This seems a bit weird.

When I'm logged in, the equation is missing from TOC

E.g.,

and the link is <a href="#Le_cycle_d'hystérésis"><span class="tocnumber">1.1</span> <span class="toctext">Le cycle d'hystérésis</span></a>

When I'm logged out, it is present:

and the link in the TOC is <a href="#Le_cycle_d'hystérésis_'&quot;UNIQ--postMath-00000001-QINU`&quot;'"><span class="tocnumber">1.1</span> <span class="toctext">Le cycle d'hystérésis <span class="mwe-math-element">...`

I tried purging the page with no change.

Does anybody have an idea what's going on here?

Something with the strip marker seems broken. T209446 might be caused by the same issue. The marker tags are generated here https://github.com/wikimedia/mediawiki-extensions-Math/blob/714b642618c6b43294dd4712dab978ada578d2f7/src/MathHooks.php#L211 and then eventually replaced here and then supposedly removed here https://github.com/wikimedia/mediawiki-extensions-Math/blob/714b642618c6b43294dd4712dab978ada578d2f7/src/MathHooks.php#L377-L379 . In this procedure there is an ugly workaround for T103269 which I guess causes the problem.