Page MenuHomePhabricator

Accessibility and/or highlighting code destroys up-arrow back links
Closed, ResolvedPublic5 Estimated Story Points


I played around with the example page (and others) and noticed a misbehavior that worries me quite much. First, I wondered about some broken HTML in the references section:

<span class="mw-cite-backlink">
<span class="mw-cite-up-arrow">^</span>
<a class="mw-cite-up-arrow-backlink" aria-label="Jump back up" title="Jump back up" href="#cite_ref-5">^</a>
<b><a href="#cite_ref-5" aria-label="Jump up" title="Jump up" class=""></a></b>

Notice that the line with the <b> is a broken link with no text.

Steps to reproduce:

  • Go to
  • Find a footnote in the article, e.g. the [5], and click it.
  • Use the little ^ to jump back up.
  • Look for another footnote, e.g. [6], and click it.
  • Now check the little ^ in the 5th footnote you clicked before. It's not a link any more, but text.

Acceptance criteria:

  • Find the issue, fix it.
  • Add a test that protects us from Regression's. -> now tracked in T217767
NOTE: The issue only happened with unnamed ("anonymous") ref tags that don't have a name="…". These get IDs like cite_ref-<#> where <#> is the sequential number of the ref, starting from 1. Named refs on the other hand, no matter if reused or not, get IDs like cite_ref-<name>_<#>-<use>, where the usage count starts from 0. If a named ref is not reused, it's ID ends with -0, and the next one ending with -1 doesn't exist. This is what the old code checked. Unfortunately, the first unnamed ref will also end with -1, which is what confused the code.

Event Timeline

Change 491774 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Cite@master] Fix highlighting code destroying backlinks on unnamed <ref>s

Change 491774 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Fix highlighting code destroying backlinks on unnamed <ref>s

thiemowmde triaged this task as Medium priority.Feb 21 2019, 9:17 AM
thiemowmde removed a project: Patch-For-Review.
thiemowmde updated the task description. (Show Details)
Lea_WMDE set the point value for this task to 5.Feb 26 2019, 3:29 PM
Lea_WMDE claimed this task.

per resolution of T217767