Page MenuHomePhabricator

Highlighting does not work if span with mw-cite-backlink class is removed
Closed, ResolvedPublic5 Estimated Story Points


The current jump mark highlighting relies on the default reference link format containing the mw-cite-backlink CSS class:

<li id=\"$1\"$4><span class=\"mw-cite-backlink\">↑ $2</span> $3</li>

Since this is part of a i18n message it can be altered and overwritten. This happened for example on en.wikipedia.beta. [1]


Event Timeline

WMDE-Fisch triaged this task as Medium priority.Nov 27 2018, 3:20 PM
WMDE-Fisch created this task.

It looks like your code also breaks on some changes to MediaWiki:Cite_references_link_many_format. Specifically, if all the formatting is inside the link instead of wrapping the link, as was the case in for example, it doesn't find the links.

Change 476246 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Cite@master] Make backlink highlighting robust when "mw-cite-backlink" is missing

Change 476246 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Make backlink highlighting robust when "mw-cite-backlink" is missing


On en.beta [1] I currently have the link format from ja.WP [2] with missing mw-cite-backlink class laoded [3]. - With the latest improvements the added arrow up backlink still works with the multiple reference [1].


We could consider backporting this so it's deployed before end of next week.

thiemowmde set the point value for this task to 5.Dec 4 2018, 9:49 AM
Lea_WMDE moved this task from Demo to Done on the WMDE-QWERTY-Sprint-2018-11-20 board.

For the record, on frwiki I have changed the classname back to the regular name (refs Cite references link one, Cite references link many), as I think it's the only proper way to handle this. The classname just shouldn't had been allowed to be renamed in the first place. Triggered by the custom name, these subsequent JavaScript workarounds were in turn causing some bug in gadget ReferenceTooltips...