Page MenuHomePhabricator

Cite: Using capitalized <ref> inside reference list creates extra backlink
Closed, ResolvedPublicBUG REPORT

Description

When using list-defined references and displaying the reference list with #tag:references (as with the reflist template on the English Wikipedia), and if the ref tag is capitalized in any manner (Ref, REF, reF, etc.) then an extra backlink is created that does not have a matching anchor.

Markup:

<ref name=foo/>
{{#tag:references|<Ref name=foo>Reference 1</ref>}}

See Template talk:Reflist#Capitalized <ref> causes extra backlink.

I tried this with <gallery> and a few other tags and did not see any issues.


Version: unspecified
Severity: minor

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:05 AM
bzimport added a project: Cite.
bzimport set Reference to bz62335.
bzimport added a subscriber: Unknown Object (MLST).
thiemowmde changed the subtype of this task from "Task" to "Bug Report".Dec 11 2023, 3:14 PM
thiemowmde added subscribers: thiemowmde, awight.

I can still reproduce this. Even found the reason. At some point the Cite code scans for Parser::MARKER_PREFIX . "-ref-". This scan is case-sensitive. But the marker is not. It's a placeholder inserted by Parser::extractTagsAndParams and later removed via the StripState class. The placeholder reflects the tag name as it originally appears in the wikitext.

The same issue appears just a few lines above in the same file. Parser::MARKER_PREFIX . "-references-" needs to be made case-insensitive as well.

Change 982127 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] Fix regular expressions not being case-insensitive

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

Change 982127 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Fix regular expressions not being case-insensitive

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