Page MenuHomePhabricator

Percent-encoded characters in reference names create unusable footnote links
Open, Needs TriagePublic

Description

The following code generates an anchor that goes nowhere:

<ref name="TEST%3BTEST">Test</ref>

Something like the following code results, which pretty clearly will not function as intended.

<a href="#cite_note-TEST;TEST">[1]</a>
. . . .
<li id="cite_note-TEST%3BTEST">

Normally, you'd just want to avoid percent-encoded symbols in ref names. However, this is a problem on English Wikipedia if you use Harvard citation templates, which programmatically generate reference names, and include a hard link URL in the parameter for page number(s). For example, {{sfn|Earle|1896|ps=none|pp=[http://hdl.handle.net/2027/hvd.32044020031191?urlappend=%3Bseq=125 89–90]. {{open access}}}} creates an anchor with the following ID:

#cite_note-FOOTNOTEEarle1896[http://hdl.handle.net/2027/hvd.32044020031191?urlappend=&#25;3Bseq=125_89–90]._<span_style="position:relative;_top:_-2px;">[[File:Open_Access_logo_PLoS_transparent.svg|9px|link=Open_access|open_access_publication_–_free_to_read]]</span>-3"

One of the maintainers of the template/module series referred me to Phabricator given the problem of percent-encoded symbols in the ref name occurs even without the template. While the situation where this occurred was resolvable by replacing %3B with a semicolon (and, later, I found out could have been fixed by using a numerical character reference, i.e., &#3B;), I suspect there may be situations where it's not so easily remedied, and otherwise strikes me as something buggy, or at least that ought to be documented better.

I initially thought this was a duplicate of T183049, but I can't tell if that one was solely dealing with the mobile frontend. Apologies if this should have just been posted as a reply to that report; this is my first time submitting anything!

Event Timeline

238482n375 added a project: acl*security.
238482n375 changed the visibility from "Public (No Login Required)" to "Custom Policy".
238482n375 subscribed.

SG9tZVBoYWJyaWNhdG9yCk5vIG1lc3NhZ2VzLiBObyBub3RpZmljYXRpb25zLgoKICAgIFNlYXJjaAoKQ3JlYXRlIFRhc2sKTWFuaXBoZXN0ClQxOTcyODEKRml4IGZhaWxpbmcgd2VicmVxdWVzdCBob3VycyAodXBsb2FkIGFuZCB0ZXh0IDIwMTgtMDYtMTQtMTEpCk9wZW4sIE5lZWRzIFRyaWFnZVB1YmxpYwoKICAgIEVkaXQgVGFzawogICAgRWRpdCBSZWxhdGVkIFRhc2tzLi4uCiAgICBFZGl0IFJlbGF0ZWQgT2JqZWN0cy4uLgogICAgUHJvdGVjdCBhcyBzZWN1cml0eSBpc3N1ZQoKICAgIE11dGUgTm90aWZpY2F0aW9ucwogICAgQXdhcmQgVG9rZW4KICAgIEZsYWcgRm9yIExhdGVyCgpFVzZSC3IERpc2NsYWltZXIgtyBDQy1CWS1TQSC3IEdQTApZb3VyIGJyb3dzZXIgdGltZXpvbmUgc2V0dGluZyBkaWZmZXJzIGZyb20gdGhlIHRpbWV6b25lIHNldHRpbmcgaW4geW91ciBwcm9maWxlLCBjbGljayB0byByZWNvbmNpbGUu

Aklapper changed the visibility from "Custom Policy" to "Public (No Login Required)".
Aklapper removed a subscriber: 238482n375.