mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-24 15:04:02 +00:00
f9bb125e4c
Note how this currently behaves. The user input is <ref name="… …"> But what we get in the end is <li id="… …"> This implies that the is decoded and re-encoded with a slightly different entity encoding. (Note that and   and   are all the same character.) Also note how there is only an underscore in the href="…", but the non-breaking space is gone. This is identical to what happens in links and headlines. Try for example [[a _a]]. Multiple underscores, non-breaking spaces, and normal spaces will be normalized. We just do the same in the id="…" attributes. Note this fixes only one of the issues listed in T298278. Bug: T298278 Change-Id: Ia01f2fdd3b3e9ee6aaa9da60ca3386dcd5d6b1a0
138 lines
6.6 KiB
Plaintext
138 lines
6.6 KiB
Plaintext
!! version 2
|
|
|
|
!! test
|
|
Legacy fragment encoding
|
|
!! config
|
|
wgFragmentMode=["legacy"]
|
|
!! wikitext
|
|
<ref name="nature%20phylo">A</ref>
|
|
<ref name="Mininova%2E26%2E11%2E2009">B</ref>
|
|
<ref name="%c8%98tiri_2019">C</ref>
|
|
<ref name="play%21">D</ref>
|
|
<ref name="Terry+O%26rsquo%3BN…</ref">E</ref>
|
|
<ref name="9 pm">F</ref>
|
|
<references />
|
|
!! html/php
|
|
<p><sup id="cite_ref-nature.2520phylo_1-0" class="reference"><a href="#cite_note-nature.2520phylo-1">[1]</a></sup>
|
|
<sup id="cite_ref-Mininova.252E26.252E11.252E2009_2-0" class="reference"><a href="#cite_note-Mininova.252E26.252E11.252E2009-2">[2]</a></sup>
|
|
<sup id="cite_ref-.25c8.2598tiri_2019_3-0" class="reference"><a href="#cite_note-.25c8.2598tiri_2019-3">[3]</a></sup>
|
|
<sup id="cite_ref-play.2521_4-0" class="reference"><a href="#cite_note-play.2521-4">[4]</a></sup>
|
|
<sup id="cite_ref-Terry.2BO.2526rsquo.253BN.E2.80.A6.3C.2Fref_5-0" class="reference"><a href="#cite_note-Terry.2BO.2526rsquo.253BN.E2.80.A6.3C.2Fref-5">[5]</a></sup>
|
|
<sup id="cite_ref-9_pm_6-0" class="reference"><a href="#cite_note-9_pm-6">[6]</a></sup>
|
|
</p>
|
|
<div class="mw-references-wrap"><ol class="references">
|
|
<li id="cite_note-nature.2520phylo-1"><span class="mw-cite-backlink"><a href="#cite_ref-nature.2520phylo_1-0">↑</a></span> <span class="reference-text">A</span>
|
|
</li>
|
|
<li id="cite_note-Mininova.252E26.252E11.252E2009-2"><span class="mw-cite-backlink"><a href="#cite_ref-Mininova.252E26.252E11.252E2009_2-0">↑</a></span> <span class="reference-text">B</span>
|
|
</li>
|
|
<li id="cite_note-.25c8.2598tiri_2019-3"><span class="mw-cite-backlink"><a href="#cite_ref-.25c8.2598tiri_2019_3-0">↑</a></span> <span class="reference-text">C</span>
|
|
</li>
|
|
<li id="cite_note-play.2521-4"><span class="mw-cite-backlink"><a href="#cite_ref-play.2521_4-0">↑</a></span> <span class="reference-text">D</span>
|
|
</li>
|
|
<li id="cite_note-Terry.2BO.2526rsquo.253BN.E2.80.A6.3C.2Fref-5"><span class="mw-cite-backlink"><a href="#cite_ref-Terry.2BO.2526rsquo.253BN.E2.80.A6.3C.2Fref_5-0">↑</a></span> <span class="reference-text">E</span>
|
|
</li>
|
|
<li id="cite_note-9_pm-6"><span class="mw-cite-backlink"><a href="#cite_ref-9_pm_6-0">↑</a></span> <span class="reference-text">F</span>
|
|
</li>
|
|
</ol></div>
|
|
!! end
|
|
|
|
!! test
|
|
FIXME: HTML5 fragment encoding
|
|
!! config
|
|
wgFragmentMode=["html5"]
|
|
!! wikitext
|
|
<ref name="nature%20phylo">A</ref>
|
|
<ref name="Mininova%2E26%2E11%2E2009">B</ref>
|
|
<ref name="%c8%98tiri_2019">C</ref>
|
|
<ref name="play%21">D</ref>
|
|
<ref name="Terry+O%26rsquo%3BN…</ref">E</ref>
|
|
<ref name="9 pm">F</ref>
|
|
<references />
|
|
!! html/php
|
|
<p><sup id="cite_ref-nature%2520phylo_1-0" class="reference"><a href="#cite_note-nature%2520phylo-1">[1]</a></sup>
|
|
<sup id="cite_ref-Mininova%252E26%252E11%252E2009_2-0" class="reference"><a href="#cite_note-Mininova%252E26%252E11%252E2009-2">[2]</a></sup>
|
|
<sup id="cite_ref-%25c8%2598tiri_2019_3-0" class="reference"><a href="#cite_note-%25c8%2598tiri_2019-3">[3]</a></sup>
|
|
<sup id="cite_ref-play%2521_4-0" class="reference"><a href="#cite_note-play%2521-4">[4]</a></sup>
|
|
<sup id="cite_ref-Terry+O%2526rsquo%253BN…</ref_5-0" class="reference"><a href="#cite_note-Terry+O%2526rsquo%253BN…</ref-5">[5]</a></sup>
|
|
<sup id="cite_ref-9_pm_6-0" class="reference"><a href="#cite_note-9_pm-6">[6]</a></sup>
|
|
</p>
|
|
<div class="mw-references-wrap"><ol class="references">
|
|
<li id="cite_note-nature%2520phylo-1"><span class="mw-cite-backlink"><a href="#cite_ref-nature%2520phylo_1-0">↑</a></span> <span class="reference-text">A</span>
|
|
</li>
|
|
<li id="cite_note-Mininova%252E26%252E11%252E2009-2"><span class="mw-cite-backlink"><a href="#cite_ref-Mininova%252E26%252E11%252E2009_2-0">↑</a></span> <span class="reference-text">B</span>
|
|
</li>
|
|
<li id="cite_note-%25c8%2598tiri_2019-3"><span class="mw-cite-backlink"><a href="#cite_ref-%25c8%2598tiri_2019_3-0">↑</a></span> <span class="reference-text">C</span>
|
|
</li>
|
|
<li id="cite_note-play%2521-4"><span class="mw-cite-backlink"><a href="#cite_ref-play%2521_4-0">↑</a></span> <span class="reference-text">D</span>
|
|
</li>
|
|
<li id="cite_note-Terry+O%2526rsquo%253BN…</ref-5"><span class="mw-cite-backlink"><a href="#cite_ref-Terry+O%2526rsquo%253BN…</ref_5-0">↑</a></span> <span class="reference-text">E</span>
|
|
</li>
|
|
<li id="cite_note-9_pm-6"><span class="mw-cite-backlink"><a href="#cite_ref-9_pm_6-0">↑</a></span> <span class="reference-text">F</span>
|
|
</li>
|
|
</ol></div>
|
|
!! end
|
|
|
|
!! test
|
|
Double URL encoding in legacy mode
|
|
!! config
|
|
wgFragmentMode=["legacy"]
|
|
!! wikitext
|
|
<ref name="n%25%32%30n" group="g%25%32%30g">A</ref>
|
|
<references group="g%25%32%30g" />
|
|
!! html/php
|
|
<p><sup id="cite_ref-n.2525.2532.2530n_1-0" class="reference"><a href="#cite_note-n.2525.2532.2530n-1">[g%25%32%30g 1]</a></sup>
|
|
</p>
|
|
<div class="mw-references-wrap"><ol class="references">
|
|
<li id="cite_note-n.2525.2532.2530n-1"><span class="mw-cite-backlink"><a href="#cite_ref-n.2525.2532.2530n_1-0">↑</a></span> <span class="reference-text">A</span>
|
|
</li>
|
|
</ol></div>
|
|
!! end
|
|
|
|
!! test
|
|
Double URL encoding in HTML5 mode
|
|
!! config
|
|
wgFragmentMode=["html5"]
|
|
!! wikitext
|
|
<ref name="n%25%32%30n" group="g%25%32%30g">A</ref>
|
|
<references group="g%25%32%30g" />
|
|
!! html/php
|
|
<p><sup id="cite_ref-n%2525%2532%2530n_1-0" class="reference"><a href="#cite_note-n%2525%2532%2530n-1">[g%25%32%30g 1]</a></sup>
|
|
</p>
|
|
<div class="mw-references-wrap"><ol class="references">
|
|
<li id="cite_note-n%2525%2532%2530n-1"><span class="mw-cite-backlink"><a href="#cite_ref-n%2525%2532%2530n_1-0">↑</a></span> <span class="reference-text">A</span>
|
|
</li>
|
|
</ol></div>
|
|
!! end
|
|
|
|
!! test
|
|
Multiple, partly encoded spaces in legacy mode
|
|
!! config
|
|
wgFragmentMode=["legacy"]
|
|
!! wikitext
|
|
<ref name="a_ %20a" group="b_ %20b">A</ref>
|
|
<references group="b_ %20b" />
|
|
!! html/php
|
|
<p><sup id="cite_ref-a_.2520a_1-0" class="reference"><a href="#cite_note-a_.2520a-1">[b_ %20b 1]</a></sup>
|
|
</p>
|
|
<div class="mw-references-wrap"><ol class="references">
|
|
<li id="cite_note-a_.2520a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_.2520a_1-0">↑</a></span> <span class="reference-text">A</span>
|
|
</li>
|
|
</ol></div>
|
|
!! end
|
|
|
|
!! test
|
|
Multiple, partly encoded spaces in HTML5 mode
|
|
!! config
|
|
wgFragmentMode=["html5"]
|
|
!! wikitext
|
|
<ref name="a_ %20a" group="b_ %20b">A</ref>
|
|
<references group="b_ %20b" />
|
|
!! html/php
|
|
<p><sup id="cite_ref-a_%2520a_1-0" class="reference"><a href="#cite_note-a_%2520a-1">[b_ %20b 1]</a></sup>
|
|
</p>
|
|
<div class="mw-references-wrap"><ol class="references">
|
|
<li id="cite_note-a_%2520a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_%2520a_1-0">↑</a></span> <span class="reference-text">A</span>
|
|
</li>
|
|
</ol></div>
|
|
!! end
|