Last modified: 2013-06-08 14:21:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29694, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27694 - HTML5 (with experimental ids) anchor encoding bug (refs only?)
HTML5 (with experimental ids) anchor encoding bug (refs only?)
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Cite (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Wikipedi...
:
Depends on:
Blocks: html5
  Show dependency treegraph
 
Reported: 2011-02-24 20:46 UTC by Derk-Jan Hartman
Modified: 2013-06-08 14:21 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Derk-Jan Hartman 2011-02-24 20:46:27 UTC
"In HTML4 mode, wikitext characters get escaped in the anchor name, e.g. <ref name="foo [[bar]]" /> generates wikitext like <sup id="cite_ref-foo_.5B.5Bbar.5D.5D_0-0" class="reference">[[#cite_note-foo_.5B.5Bbar.5D.5D-0|[1]]]</sup>; note the brackets have changed to ".5B" and ".5D". In HTML5 mode, these characters aren't escaped, generating <sup id="cite_ref-foo_[[bar]]_0-0" class="reference">[[#cite_note-foo_[[bar]]-0|[1]]]</sup> instead, with brackets inside the attempted wikilink. Since brackets cannot actually appear inside a wikilink, boom. Anomie⚔"
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2011-02-24 22:17:49 UTC
This is actually due to $wgExperimentalHtmlIds, not $wgHtml5.  It's just that the former does nothing unless the latter is true.  This should be fixable in Cite by not encoding the ref name in the anchor name, just generate an arbitrary one.
Comment 2 MZMcBride 2012-06-30 01:04:41 UTC
(In reply to comment #0)
> "In HTML4 mode, wikitext characters get escaped in the anchor name, e.g. <ref
> name="foo [[bar]]" /> generates wikitext like <sup
> id="cite_ref-foo_.5B.5Bbar.5D.5D_0-0"
> class="reference">[[#cite_note-foo_.5B.5Bbar.5D.5D-0|[1]]]</sup>; note the
> brackets have changed to ".5B" and ".5D". In HTML5 mode, these characters
> aren't escaped, generating <sup id="cite_ref-foo_[[bar]]_0-0"
> class="reference">[[#cite_note-foo_[[bar]]-0|[1]]]</sup> instead, with brackets
> inside the attempted wikilink. Since brackets cannot actually appear inside a
> wikilink, boom. Anomie⚔"

Is this still an issue? According to <https://noc.wikimedia.org/conf/InitialiseSettings.php.txt>:

---
'wgHtml5' => array(
	'default' => false,
	'mediawikiwiki' => true,
	'testwiki' => true,
	'test2wiki' => true,
),
---

Using the following wikitext on test.wikipedia.org (testwiki) at <https://test.wikipedia.org/wiki/Cite_using_HTML5>:

---
Hello there.<ref name="foo [[bar]]">author</ref><ref name="foo [[bar]]" />

== References ==
<references />
---

Generated HTML looks like this:

---
<p>Hello there.<sup id="cite_ref-foo_.5B.5Bbar.5D.5D_0-0" class="reference"><a href="#cite_note-foo_.5B.5Bbar.5D.5D-0">1</a><span class="reference_comma">,</span></sup><sup id="cite_ref-foo_.5B.5Bbar.5D.5D_0-1" class="reference"><a href="#cite_note-foo_.5B.5Bbar.5D.5D-0">1</a><span class="reference_comma">,</span></sup></p>
<h2> <span class="mw-headline" id="References">References</span></h2>
<ol class="references">
<li id="cite_note-foo_.5B.5Bbar.5D.5D-0"><span class="mw-cite-backlink">^ <span class="citerefmanylink"><a href="#cite_ref-foo_.5B.5Bbar.5D.5D_0-0"><sup><i><b>a</b></i></sup></a></span> <span class="citerefmanylink"><a href="#cite_ref-foo_.5B.5Bbar.5D.5D_0-1"><sup><i><b>b</b></i></sup></a></span></span> <span class="reference-text">author</span></li>
</ol>
---

This bug appears to be fixed. Can someone confirm?
Comment 3 Brad Jorsch 2012-07-01 04:51:18 UTC
(In reply to comment #2)
> Using the following wikitext on test.wikipedia.org (testwiki) at

Does test.wikipedia.org have $wgExperimentalHtmlIds on or off?
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2012-07-01 05:22:53 UTC
Well, it defaults to false, because it's experimental:

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/DefaultSettings.php;h=35ae6bda3c99ac00fab215d39b71d8bb7a1ff5f1;hb=HEAD#l2500

If no one is actively developing it and fixing its bugs, it should probably remain false, or just be removed.  I hope no one tried turning it on anywhere.
Comment 5 Brad Jorsch 2012-07-01 05:31:09 UTC
(In reply to comment #4)
> I hope no one tried turning it on anywhere.

I guess someone did in February 2011.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links