mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-23 22:45:20 +00:00
Sync up with Parsoid citeParserTests.txt
This now aligns with Parsoid commit 12d896bd5852b4a7d602fb22dd09d7fc2c5c5b64 Change-Id: I1d3183ee4afa37e0d71768cd02f03112771b82c4
This commit is contained in:
parent
829d11c4a4
commit
45cc963ca2
|
@ -1,4 +1,5 @@
|
|||
!! version 2
|
||||
|
||||
# Force the test runner to ensure the extension is loaded
|
||||
!! hooks
|
||||
ref
|
||||
|
@ -52,7 +53,7 @@ blah<ref>foo</ref> --Matma Rex 17:35, 31 March 2020 (UTC)
|
|||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p data-parsoid='{}'>blah<sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> --Matma Rex 17:35, 31 March 2020 (UTC)</p>
|
||||
<p>blah<sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> --Matma Rex 17:35, 31 March 2020 (UTC)</p>
|
||||
<ul><li>bleh --Matma Rex 17:35, 31 March 2020 (UTC)</li></ul>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li></ol></div>
|
||||
!! end
|
||||
|
@ -132,6 +133,10 @@ Templating<nowiki><ref>{{simple template}}</ref></nowiki>
|
|||
<p>Templating<ref>{{simple template}}</ref>
|
||||
</p><p><br />
|
||||
</p>
|
||||
!! html/parsoid
|
||||
<p>Templating<span typeof="mw:Nowiki"><ref>{{simple template}}</ref></span></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -144,6 +149,10 @@ Templating<!--<ref>{{simple template}}</ref>-->
|
|||
<p>Templating
|
||||
</p><p><br />
|
||||
</p>
|
||||
!! html/parsoid
|
||||
<p>Templating</p><!--<ref>{{simple template}}</ref>-->
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -278,6 +287,9 @@ parsoid=wt2html,html2html
|
|||
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">elite</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><span about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONID","function":"revisionid"},"params":{},"i":0}}]}'>1337</span><sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">elite</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -287,6 +299,8 @@ parsoid=wt2html,html2html
|
|||
!! html
|
||||
<p>1337
|
||||
</p>
|
||||
!! html/parsoid
|
||||
<p><span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"REVISIONID","function":"revisionid"},"params":{},"i":0}}]}'>1337</span></p>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -406,6 +420,12 @@ Ref names containing a number
|
|||
<li id="cite_note-test123-3"><span class="mw-cite-backlink"><a href="#cite_ref-test123_3-0">↑</a></span> <span class="reference-text">Three</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-test123test_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"test123test"},"body":{"id":"mw-reference-text-cite_note-test123test-1"}}'><a href="./Parser_test#cite_note-test123test-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
|
||||
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-123test_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"123test"},"body":{"id":"mw-reference-text-cite_note-123test-2"}}'><a href="./Parser_test#cite_note-123test-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup>
|
||||
<sup about="#mwt9" class="mw-ref reference" id="cite_ref-test123_3-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"test123"},"body":{"id":"mw-reference-text-cite_note-test123-3"}}'><a href="./Parser_test#cite_note-test123-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-test123test-1" id="cite_note-test123test-1"><a href="./Parser_test#cite_ref-test123test_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-test123test-1" class="mw-reference-text">One</span></li><li about="#cite_note-123test-2" id="cite_note-123test-2"><a href="./Parser_test#cite_ref-123test_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-123test-2" class="mw-reference-text">Two</span></li><li about="#cite_note-test123-3" id="cite_note-test123-3"><a href="./Parser_test#cite_ref-test123_3-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-test123-3" class="mw-reference-text">Three</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
## Note that the underscores are normalized in the id only and these remain
|
||||
|
@ -652,24 +672,6 @@ Forward-referenced ref with follow
|
|||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt7\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid='{\"dsr\":[75,109,20,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"theName\"},\"body\":{\"html\":\"theValue\"},\"errors\":[{\"key\":\"cite_error_references_duplicate_key\",\"params\":[\"theName\"]}]}'><a href=\"./Parser_test#cite_note-theName-1\" style=\"counter-reset: mw-Ref 1;\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[1]</span></a></sup>\n"}}'><ol class="mw-references references"><li about="#cite_note-theName-1" id="cite_note-theName-1"><a href="./Parser_test#cite_ref-theName_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-theName-1" class="mw-reference-text"><span typeof="mw:Cite/Follow" about="#mwt4"> theFollows</span></span></li></ol></div>
|
||||
!! end
|
||||
|
||||
## FIXME: Parsoid needs to strip the mw:Cite/Follow wrapper for this to pass
|
||||
!! test
|
||||
Forward-referenced ref with magical follow edge case
|
||||
!! wikitext
|
||||
<ref name="theName" />
|
||||
<ref follow="theName">theValue</ref>
|
||||
<references>
|
||||
<ref name="theName"> theValue</ref>
|
||||
</references>
|
||||
!! html
|
||||
<p><sup id="cite_ref-theName_1-0" class="reference"><a href="#cite_note-theName-1">[1]</a></sup>
|
||||
</p>
|
||||
<div class="mw-references-wrap"><ol class="references">
|
||||
<li id="cite_note-theName-1"><span class="mw-cite-backlink"><a href="#cite_ref-theName_1-0">↑</a></span> <span class="reference-text"> theValue</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
Follow following a named ref with multiple definitions
|
||||
!! wikitext
|
||||
|
@ -712,6 +714,7 @@ MOD<sup about="#mwt8" class="mw-ref reference mw-ref-follow" rel="dc:references"
|
|||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt11\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"theName\"},\"body\":{\"html\":\" theValue\"},\"errors\":[{\"key\":\"cite_error_references_duplicate_key\",\"params\":[\"theName\"]}]}'><a href=\"./Parser_test#cite_note-theName-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n"}}'><ol class="mw-references references"><li about="#cite_note-theName-1" id="cite_note-theName-1"><span rel="mw:referencedBy"><a href="./Parser_test#cite_ref-theName_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-theName_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-theName-1" class="mw-reference-text"><span typeof="mw:Cite/Follow" about="#mwt6"> theFollowValue</span><span typeof="mw:Cite/Follow" about="#mwt8"> anotherFollowValue</span></span></li></ol></div>
|
||||
!!end
|
||||
|
||||
# T307741: Parsoid fails this test in both standalone and integrated modes.
|
||||
!! test
|
||||
Valid parameters become invalid when a third is present
|
||||
!! wikitext
|
||||
|
@ -742,6 +745,12 @@ Wikipedia rocks!<sup id="cite_ref-2" class="reference"><a href="#cite_note-2">&#
|
|||
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">Proceeds of Rockology, vol. XXI</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p>Wikipedia rocks!<sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
|
||||
Wikipedia rocks!<sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"note"},"body":{"id":"mw-reference-text-cite_note-2"}}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 1;" data-mw-group="note"><span class="mw-reflink-text">[note 1]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt7" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">Proceeds of Rockology, vol. XXI</span></li></ol></div>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt10" data-mw='{"name":"references","attrs":{"group":"note"}}'><ol class="mw-references references" data-mw-group="note"><li about="#cite_note-2" id="cite_note-2"><a href="./Parser_test#cite_ref-2" data-mw-group="note" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">Proceeds of Rockology, vol. XXI</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -769,10 +778,22 @@ AAA<ref group="参">ref a</ref>BBB<ref group="注">note b</ref>CCC<ref group="
|
|||
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">note b</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p>AAA<sup about="#mwt4" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"参"},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;" data-mw-group="参"><span class="mw-reflink-text">[参 1]</span></a></sup>BBB<sup about="#mwt5" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"注"},"body":{"id":"mw-reference-text-cite_note-2"}}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 1;" data-mw-group="注"><span class="mw-reflink-text">[注 1]</span></a></sup>CCC<sup about="#mwt6" class="mw-ref reference" id="cite_ref-3" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"参"},"body":{"id":"mw-reference-text-cite_note-3"}}'><a href="./Parser_test#cite_note-3" style="counter-reset: mw-Ref 2;" data-mw-group="参"><span class="mw-reflink-text">[参 2]</span></a></sup></p>
|
||||
|
||||
<dl><dt>refs</dt></dl>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{"group":"参"}}'><ol class="mw-references references" data-mw-group="参"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" data-mw-group="参" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">ref a</span></li><li about="#cite_note-3" id="cite_note-3"><a href="./Parser_test#cite_ref-3" data-mw-group="参" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-3" class="mw-reference-text">ref c</span></li></ol></div>
|
||||
|
||||
<dl><dt>notes</dt></dl>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" data-mw='{"name":"references","attrs":{"group":"注"}}'><ol class="mw-references references" data-mw-group="注"><li about="#cite_note-2" id="cite_note-2"><a href="./Parser_test#cite_ref-2" data-mw-group="注" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">note b</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
## No point running non-wt2html modes with Parsoid since the " g "
|
||||
## will get normalized and html2wt, wt2wt, html2html modes will fail.
|
||||
!! test
|
||||
Attributes are trimmed by the parser, see Sanitizer::decodeTagAttributes()
|
||||
!! options
|
||||
parsoid=wt2html
|
||||
!! wikitext
|
||||
<ref group="g" name="n1">in group g</ref>
|
||||
<ref group=" g " name=" n2 ">in group " g "</ref>
|
||||
|
@ -788,6 +809,11 @@ Attributes are trimmed by the parser, see Sanitizer::decodeTagAttributes()
|
|||
<li id="cite_note-n2-2"><span class="mw-cite-backlink"><a href="#cite_ref-n2_2-0">↑</a></span> <span class="reference-text">in group " g "</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-n1_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"g","name":"n1"},"body":{"id":"mw-reference-text-cite_note-n1-1"}}'><a href="./Parser_test#cite_note-n1-1" style="counter-reset: mw-Ref 1;" data-mw-group="g"><span class="mw-reflink-text">[g 1]</span></a></sup>
|
||||
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-n2_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"g","name":"n2"},"body":{"id":"mw-reference-text-cite_note-n2-2"}}'><a href="./Parser_test#cite_note-n2-2" style="counter-reset: mw-Ref 2;" data-mw-group="g"><span class="mw-reflink-text">[g 2]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{"group":"g"}}'><ol class="mw-references references" data-mw-group="g"><li about="#cite_note-n1-1" id="cite_note-n1-1"><a href="./Parser_test#cite_ref-n1_1-0" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-n1-1" class="mw-reference-text">in group g</span></li><li about="#cite_note-n2-2" id="cite_note-n2-2"><a href="./Parser_test#cite_ref-n2_2-0" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-n2-2" class="mw-reference-text">in group " g "</span></li></ol></div>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" data-mw='{"name":"references","attrs":{"group":"g"}}'><ol class="mw-references references" data-mw-group="g"></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -805,6 +831,10 @@ Attributes are trimmed by the parser, see Sanitizer::decodeTagAttributes()
|
|||
<li id="cite_note-foo-1"><span class="mw-cite-backlink"><a href="#cite_ref-foo_1-0">↑</a></span> <span class="reference-text">BAR</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-foo_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"foo"}}'><a href="./Parser_test#cite_note-foo-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt8\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[33,58,16,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"},\"body\":{\"id\":\"mw-reference-text-cite_note-foo-1\"}}'><a href=\"./Parser_test#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[1]</span></a></sup>\n"}}'><ol class="mw-references references"><li about="#cite_note-foo-1" id="cite_note-foo-1"><a href="./Parser_test#cite_ref-foo_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text">BAR</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -822,8 +852,13 @@ Attributes are trimmed by the parser, see Sanitizer::decodeTagAttributes()
|
|||
<li id="cite_note-foo-1"><span class="mw-cite-backlink"><a href="#cite_ref-foo_1-0">↑</a></span> <span class="reference-text">BAR</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-foo_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"foo"}}'><a href="./Parser_test#cite_note-foo-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Transclusion" about="#mwt6" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:references","function":"tag"},"params":{"1":{"wt":"\n<ref name=\"foo\">BAR</ref>\n"}},"i":0}}]}'><ol class="mw-references references"><li about="#cite_note-foo-1" id="cite_note-foo-1"><a href="./Parser_test#cite_ref-foo_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text">BAR</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
# T307741: Parsoid fails this test in both standalone and integrated modes.
|
||||
!! test
|
||||
T242437 - Nested references edge case, outer tag function with LDR
|
||||
!! wikitext
|
||||
|
@ -839,6 +874,7 @@ T242437 - Nested references edge case, outer tag function with LDR
|
|||
</p>
|
||||
!! end
|
||||
|
||||
# T307741: Parsoid fails this test in both standalone and integrated modes.
|
||||
!! test
|
||||
T242437 - Nested references edge case, outer tag function, inner LDR
|
||||
!! wikitext
|
||||
|
@ -871,6 +907,10 @@ T242437 - Nested references edge case, inner tag function with LDR
|
|||
<li id="cite_note-foo-1"><span class="mw-cite-backlink"><a href="#cite_ref-foo_1-0">↑</a></span> <span class="reference-text">bar</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-foo_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"foo"}}'><a href="./Parser_test#cite_note-foo-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt13" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt11\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"src\":\"&lt;ref name=\\\"foo\\\">bar&lt;/ref>\"}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"},\"body\":{\"id\":\"mw-reference-text-cite_note-foo-1\"}}'><a href=\"./Parser_test#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[1]</span></a></sup>\n"}}'><ol class="mw-references references"><li about="#cite_note-foo-1" id="cite_note-foo-1"><a href="./Parser_test#cite_ref-foo_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text">bar</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -967,12 +1007,18 @@ Error conditions on non-visible content
|
|||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt11\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid='{\"dsr\":[74,90,16,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"a\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"a\"]}]}'><a href=\"./Parser_test#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n<sup about=\"#mwt12\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid='{\"dsr\":[91,107,16,0]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"b\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"b\"]},{\"key\":\"cite_error_references_no_text\"}]}'><a href=\"./Parser_test#cite_note-b-2\" style=\"counter-reset: mw-Ref 2;\"><span class=\"mw-reflink-text\">[2]</span></a></sup>\n<sup about=\"#mwt13\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid='{\"dsr\":[108,129,14,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"c\"},\"body\":{\"html\":\" \"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"c\"]},{\"key\":\"cite_error_references_no_text\"}]}'><a href=\"./Parser_test#cite_note-c-3\" style=\"counter-reset: mw-Ref 3;\"><span class=\"mw-reflink-text\">[3]</span></a></sup>\n"}}'><ol class="mw-references references"><li about="#cite_note-a-1" id="cite_note-a-1"><a href="./Parser_test#cite_ref-a_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text">x</span></li><li about="#cite_note-b-2" id="cite_note-b-2"><a href="./Parser_test#cite_ref-b_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-b-2" class="mw-reference-text"></span></li><li about="#cite_note-c-3" id="cite_note-c-3"><a href="./Parser_test#cite_ref-c_3-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-c-3" class="mw-reference-text"></span></li></ol></div>
|
||||
!! end
|
||||
|
||||
# This article is used in the '<ref> with custom group link' test below
|
||||
!! article
|
||||
MediaWiki:cite_link_label_group-klingon
|
||||
!! text
|
||||
wa' cha' wej loS vagh jav Soch chorgh Hut wa'maH
|
||||
!! endarticle
|
||||
|
||||
## Parsoid doesn't use messages for i18n. It relies on Cite-specific CSS rules
|
||||
## to localize. This CSS is expected to be added to a wiki's
|
||||
## MediaWiki:Common.css page.
|
||||
## As such, Parsoid's output will differ for klingon i18n label tests.
|
||||
## T308094: document this transition.
|
||||
!! test
|
||||
<ref> with custom group link with number names in Klingon
|
||||
!! wikitext
|
||||
|
@ -986,8 +1032,13 @@ Wikipedia rocks!<ref group="klingon">Proceeds of Rockology, vol. XXI</ref>
|
|||
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Proceeds of Rockology, vol. XXI</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p>Wikipedia rocks!<sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"klingon"},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;" data-mw-group="klingon"><span class="mw-reflink-text">[klingon 1]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{"group":"klingon"}}'><ol class="mw-references references" data-mw-group="klingon"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" data-mw-group="klingon" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">Proceeds of Rockology, vol. XXI</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
# See above: Parsoid uses a different mechanism for custom link labels
|
||||
!! test
|
||||
Consecutive whitespace in custom link label message should not create empty []
|
||||
!! wikitext
|
||||
|
@ -1004,6 +1055,10 @@ Consecutive whitespace in custom link label message should not create empty []
|
|||
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">2nd</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"klingon"},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;" data-mw-group="klingon"><span class="mw-reflink-text">[klingon 1]</span></a></sup>
|
||||
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"klingon"},"body":{"id":"mw-reference-text-cite_note-2"}}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;" data-mw-group="klingon"><span class="mw-reflink-text">[klingon 2]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{"group":"klingon"}}'><ol class="mw-references references" data-mw-group="klingon"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" data-mw-group="klingon" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">1st</span></li><li about="#cite_note-2" id="cite_note-2"><a href="./Parser_test#cite_ref-2" data-mw-group="klingon" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">2nd</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -1023,6 +1078,10 @@ Bug 31374 regression check: nested strip items
|
|||
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">reference</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"parts":[{"template":{"target":{"wt":"#tag:ref","function":"tag"},"params":{"1":{"wt":"note<ref>reference</ref>"},"group":{"wt":"Note"}},"i":0}}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 1;" data-mw-group="Note"><span class="mw-reflink-text">[Note 1]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt10" data-mw='{"name":"references","attrs":{"group":"Note"}}'><ol class="mw-references references" data-mw-group="Note"><li about="#cite_note_2" id="cite_note-2"><a href="./Parser_test#cite_ref-2" data-mw-group="Note" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">note<sup about="#mwt6" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></span></li></ol></div>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt13" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">reference</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -1034,7 +1093,7 @@ parsoid={"suppressErrors": true}
|
|||
foo
|
||||
</ref>
|
||||
<div><references /></div>
|
||||
!! html/*
|
||||
!! html/php
|
||||
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup>
|
||||
</p>
|
||||
<div><div class="mw-references-wrap"><ol class="references">
|
||||
|
@ -1042,6 +1101,11 @@ foo
|
|||
foo</span>
|
||||
</li>
|
||||
</ol></div></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
<div><div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">
|
||||
foo
|
||||
</span></li></ol></div></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -1188,6 +1252,7 @@ Multiple definition (mixed outside/inside)
|
|||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt7\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid='{\"dsr\":[37,60,14,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"a\"},\"body\":{\"html\":\"def\"},\"errors\":[{\"key\":\"cite_error_references_duplicate_key\",\"params\":[\"a\"]}]}'><a href=\"./Parser_test#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[1]</span></a></sup>\n"}}'><ol class="mw-references references"><li about="#cite_note-a-1" id="cite_note-a-1"><a href="./Parser_test#cite_ref-a_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text">abc</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
# T307741: Parsoid fails this test in both standalone and integrated modes.
|
||||
!! test
|
||||
Multiple definition (inside {{#tag:references}})
|
||||
!! wikitext
|
||||
|
@ -1197,20 +1262,13 @@ Multiple definition (inside {{#tag:references}})
|
|||
<ref name="a">def</ref>
|
||||
}}
|
||||
<references />
|
||||
!! html/php
|
||||
!! html
|
||||
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1">[1]</a></sup>
|
||||
</p>
|
||||
<div class="mw-references-wrap"><ol class="references">
|
||||
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">abc <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name "a" defined multiple times with different content</span></span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a"}}'><a href="./Parser_test#cite_note-a-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
|
||||
<references about="#mwt6" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:references","function":"tag"},"params":{"1":{"wt":"\n<ref name=\"a\">abc</ref>\n<ref name=\"a\">def</ref>\n"}},"i":0}}]}'>
|
||||
<sup about="#mwt8" class="mw-ref reference" id="cite_ref-a_1-1" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref name=\"a\">abc</ref>"}' data-mw='{"name":"ref","attrs":{"name":"a"},"body":{"id":"mw-reference-text-cite_note-a-1"}}'><a href="./Parser_test#cite_note-a-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
|
||||
<sup about="#mwt10" class="mw-ref reference" id="cite_ref-a_1-2" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-parsoid='{"src":"<ref name=\"a\">def</ref>"}' data-mw='{"name":"ref","attrs":{"name":"a"},"body":{"html":"def"},"errors":[{"key":"cite_error_references_duplicate_key","params":["a"]}]}'><a href="./Parser_test#cite_note-a-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
|
||||
</references></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt11" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-a-1" id="cite_note-a-1"><span rel="mw:referencedBy"><a href="./Parser_test#cite_ref-a_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-a_1-1"><span class="mw-linkback-text">2 </span></a><a href="./Parser_test#cite_ref-a_1-2"><span class="mw-linkback-text">3 </span></a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text">abc</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
# Parsoid doesn't rt cleanly because name attribute is actually broken
|
||||
|
@ -1218,7 +1276,7 @@ Multiple definition (inside {{#tag:references}})
|
|||
!! test
|
||||
T29694 - [] in reference names in HTML5 fragment mode
|
||||
!! config
|
||||
wgFragmentMode=[ 'html5' ]
|
||||
wgFragmentMode=[ "html5" ]
|
||||
!! options
|
||||
parsoid=wt2html
|
||||
!! wikitext
|
||||
|
@ -1238,7 +1296,7 @@ parsoid=wt2html
|
|||
!! test
|
||||
T29694 - [] in reference names in HTML5 fragment mode (tidied)
|
||||
!! config
|
||||
wgFragmentMode=[ 'html5' ]
|
||||
wgFragmentMode=[ "html5" ]
|
||||
!! wikitext
|
||||
<ref name="[#foo] {bar} <baz>">[bar]</ref>
|
||||
<references />
|
||||
|
@ -1551,7 +1609,7 @@ Ref: 17. Generate valid HTML5 id/about attributes
|
|||
!! test
|
||||
Ref: 18. T58916: Extension attributes should be parsed as plain text
|
||||
!! config
|
||||
wgFragmentMode=[ 'html5', 'legacy' ]
|
||||
wgFragmentMode=[ "html5", "legacy" ]
|
||||
!! wikitext
|
||||
<ref name="{{1x|a}}">foo</ref>
|
||||
|
||||
|
@ -1564,7 +1622,7 @@ wgFragmentMode=[ 'html5', 'legacy' ]
|
|||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup class="mw-ref reference" id="cite_ref-{{1x|a}}_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"{{1x|a}}"},"body":{"id":"mw-reference-text-cite_note-{{1x|a}}-1"}}'><a href="./Parser_test#cite_note-{{1x|a}}-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
|
||||
<p><sup about="#mwt1" class="mw-ref reference" id="cite_ref-{{1x|a}}_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"{{1x|a}}"},"body":{"id":"mw-reference-text-cite_note-{{1x|a}}-1"}}'><a href="./Parser_test#cite_note-{{1x|a}}-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
|
||||
</p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references">
|
||||
|
@ -1577,7 +1635,7 @@ wgFragmentMode=[ 'html5', 'legacy' ]
|
|||
!! test
|
||||
Ref: 19. ref-tags with identical name encodings should get identical indexes
|
||||
!! config
|
||||
wgFragmentMode=[ 'html5', 'legacy' ]
|
||||
wgFragmentMode=[ "html5", "legacy" ]
|
||||
!! options
|
||||
parsoid=wt2html,html2html
|
||||
!! wikitext
|
||||
|
@ -1758,6 +1816,14 @@ B <ref group="g">bar</ref>
|
|||
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">bar</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p>A <sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"g"},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;" data-mw-group="g"><span class="mw-reflink-text">[g 1]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{"group":"g"}}'><ol class="mw-references references" data-mw-group="g"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li></ol></div>
|
||||
|
||||
<p>B <sup about="#mwt7" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"g"},"body":{"id":"mw-reference-text-cite_note-2"}}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 1;" data-mw-group="g"><span class="mw-reflink-text">[g 1]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt10" data-mw='{"name":"references","attrs":{"group":"g"}}'><ol class="mw-references references" data-mw-group="g"><li about="#cite_note-2" id="cite_note-2"><a href="./Parser_test#cite_ref-2" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">bar</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -1901,7 +1967,7 @@ References: 9. Generate missing references list at the end
|
|||
A <ref>foo</ref>
|
||||
B <ref group="inexistent">bar</ref>
|
||||
!! html/parsoid
|
||||
<p>A <sup class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> B <sup class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"inexistent"},"body":{"id":"mw-reference-text-cite_note-2"},"errors":[{"key":"cite_error_group_refs_without_references","params":["inexistent"]}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 1;" data-mw-group="inexistent"><span class="mw-reflink-text">[inexistent 1]</span></a></sup></p>
|
||||
<p>A <sup about="#mwt1" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> B <sup class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"inexistent"},"body":{"id":"mw-reference-text-cite_note-2"},"errors":[{"key":"cite_error_group_refs_without_references","params":["inexistent"]}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 1;" data-mw-group="inexistent"><span class="mw-reflink-text">[inexistent 1]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references">
|
||||
<li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li>
|
||||
</ol></div>
|
||||
|
@ -1928,12 +1994,14 @@ A <ref>foo</ref>
|
|||
|
||||
!! test
|
||||
References: 10.2. New <references/> shouldn't be added for unrelated edits.
|
||||
!! config
|
||||
wgCiteResponsiveReferences=true
|
||||
wgCiteResponsiveReferencesThreshold=2
|
||||
!! options
|
||||
parsoid={
|
||||
"modes": ["selser"],
|
||||
"changes": [["#x", "remove"]],
|
||||
"selser": "noauto",
|
||||
"responsiveReferences": { "enabled": true, "threshold": 2 }
|
||||
"selser": "noauto"
|
||||
}
|
||||
!! wikitext
|
||||
Unrelated text<span id="x"> that's going to disappear</span>.
|
||||
|
@ -2040,7 +2108,7 @@ aDifferentNameGROUP <sup about="#mwt14" class="mw-ref reference" id="cite_ref-an
|
|||
!! test
|
||||
Entities in ref name
|
||||
!! config
|
||||
wgFragmentMode=[ 'html5', 'legacy' ]
|
||||
wgFragmentMode=[ "html5", "legacy" ]
|
||||
!! options
|
||||
parsoid=wt2html,html2html
|
||||
!! wikitext
|
||||
|
@ -2120,10 +2188,6 @@ test <ref>hi {{refinref|ho}}</ref>
|
|||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">hi <span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"refinref","href":"./Template:Refinref"},"params":{"1":{"wt":"ho"}},"i":0}}]}'></span></span></li></ol></div>
|
||||
!! end
|
||||
|
||||
## Similarly, when ref contents are processed by the legacy parser, the frame
|
||||
## parameters will not be around, so template arguments fail to be populated.
|
||||
## Parsoid processing happens in a different order, where it has access to
|
||||
## the frame.
|
||||
!! test
|
||||
Ref in ref: top level ref nested in transclusion
|
||||
!! wikitext
|
||||
|
@ -2137,23 +2201,16 @@ test {{refinref|456<ref>123</ref>}}
|
|||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p>test <sup about="#mwt2" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"parts":[{"template":{"target":{"wt":"refinref","href":"./Template:Refinref"},"params":{"1":{"wt":"456<ref>123</ref>"}},"i":0}}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt7" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">123</span></li><li about="#cite_note-2" id="cite_note-2"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">456<sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></span></li></ol></div>
|
||||
<p>test <sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"parts":[{"template":{"target":{"wt":"refinref","href":"./Template:Refinref"},"params":{"1":{"wt":"456<ref>123</ref>"}},"i":0}}]}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt7" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references">
|
||||
<li id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">{{{1}}}</span></li>
|
||||
</ol></div>
|
||||
!! end
|
||||
|
||||
## This is the common way that wikis use nested references. The reference
|
||||
## in the arguments will go through extension substitution before being
|
||||
## passed to the parser function so, in contrast, it'll already have been
|
||||
## processed by the time the parser gets to the outer ref's contents.
|
||||
##
|
||||
## Parsoid doesn't have support for the tag parser function in parserTests so
|
||||
## the section is omitted. However, there is a curio buried here. The call to
|
||||
## the legacy parser to expand this example will result in the kind of nesting
|
||||
## the legacy preprocessor is bound to reject (<ref>456<ref>123</ref></ref>).
|
||||
## Parsoid, therefore, has some special handling in the grammar for nested
|
||||
## extension tags when the wikitext comes from template expansion (inTemplate),
|
||||
## specifically for this case. Unfortunately, it opens up some permissiveness
|
||||
## not found in the legacy parser.
|
||||
!! test
|
||||
Ref in ref: top level ref nested in parser function
|
||||
!! wikitext
|
||||
|
@ -2168,6 +2225,23 @@ test {{#tag:ref|456<ref>123</ref>}}
|
|||
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">456<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup></span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p>test <sup about="#mwt2" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:ref","function":"tag"},"params":{"1":{"wt":"456<ref>123</ref>"}},"i":0}}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt10" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">123</span></li><li about="#cite_note-2" id="cite_note-2"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">456<sup about="#mwt6" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>123</ref>"}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></span></li></ol></div>
|
||||
!! end
|
||||
|
||||
## Parsoid is choosing not to support this.
|
||||
!! test
|
||||
Ref in ref: self-referential
|
||||
!! wikitext
|
||||
{{#tag:ref|<ref name="x" />|name=x}}
|
||||
!! html/php
|
||||
<p><sup id="cite_ref-x_1-1" class="reference"><a href="#cite_note-x-1">[1]</a></sup>
|
||||
</p>
|
||||
<div class="mw-references-wrap"><ol class="references">
|
||||
<li id="cite_note-x-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-x_1-0">1.0</a></sup> <sup><a href="#cite_ref-x_1-1">1.1</a></sup></span> <span class="reference-text"><sup id="cite_ref-x_1-0" class="reference"><a href="#cite_note-x-1">[1]</a></sup></span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! end
|
||||
|
||||
## Bleh! Only to be used in the below. See above where the legacy parser
|
||||
|
@ -2193,10 +2267,12 @@ test {{nestedrefslash}}
|
|||
|
||||
!! test
|
||||
Responsive references: disabled, autogenerated
|
||||
!! config
|
||||
wgCiteResponsiveReferences=false
|
||||
wgCiteResponsiveReferencesThreshold=2
|
||||
!! options
|
||||
parsoid={
|
||||
"modes": ["wt2html"],
|
||||
"responsiveReferences": { "enabled": false, "threshold": 2 }
|
||||
"modes": ["wt2html"]
|
||||
}
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
|
@ -2207,10 +2283,12 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: enabled, autogenerated
|
||||
!! config
|
||||
wgCiteResponsiveReferences=true
|
||||
wgCiteResponsiveReferencesThreshold=2
|
||||
!! options
|
||||
parsoid={
|
||||
"modes": ["wt2html"],
|
||||
"responsiveReferences": { "enabled": true, "threshold": 2 }
|
||||
"modes": ["wt2html"]
|
||||
}
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
|
@ -2221,10 +2299,12 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: enabled, autogenerated, exceed
|
||||
!! config
|
||||
wgCiteResponsiveReferences=true
|
||||
wgCiteResponsiveReferencesThreshold=1
|
||||
!! options
|
||||
parsoid={
|
||||
"modes": ["wt2html"],
|
||||
"responsiveReferences": { "enabled": true, "threshold": 1 }
|
||||
"modes": ["wt2html"]
|
||||
}
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
|
@ -2235,10 +2315,9 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: disabled
|
||||
!! options
|
||||
parsoid={
|
||||
"responsiveReferences": { "enabled": false, "threshold": 2 }
|
||||
}
|
||||
!! config
|
||||
wgCiteResponsiveReferences=false
|
||||
wgCiteResponsiveReferencesThreshold=2
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
<references />
|
||||
|
@ -2249,10 +2328,9 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: enabled
|
||||
!! options
|
||||
parsoid={
|
||||
"responsiveReferences": { "enabled": true, "threshold": 2 }
|
||||
}
|
||||
!! config
|
||||
wgCiteResponsiveReferences=true
|
||||
wgCiteResponsiveReferencesThreshold=2
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
<references />
|
||||
|
@ -2263,10 +2341,9 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: enabled, exceed
|
||||
!! options
|
||||
parsoid={
|
||||
"responsiveReferences": { "enabled": true, "threshold": 1 }
|
||||
}
|
||||
!! config
|
||||
wgCiteResponsiveReferences=true
|
||||
wgCiteResponsiveReferencesThreshold=1
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
<references />
|
||||
|
@ -2277,10 +2354,9 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: disabled, explicit
|
||||
!! options
|
||||
parsoid={
|
||||
"responsiveReferences": { "enabled": false, "threshold": 2 }
|
||||
}
|
||||
!! config
|
||||
wgCiteResponsiveReferences=false
|
||||
wgCiteResponsiveReferencesThreshold=2
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
<references responsive="" />
|
||||
|
@ -2291,10 +2367,9 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: disabled, explicit, exceed
|
||||
!! options
|
||||
parsoid={
|
||||
"responsiveReferences": { "enabled": false, "threshold": 1 }
|
||||
}
|
||||
!! config
|
||||
wgCiteResponsiveReferences=false
|
||||
wgCiteResponsiveReferencesThreshold=1
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
<references responsive="" />
|
||||
|
@ -2305,10 +2380,9 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: enabled, explicit off
|
||||
!! options
|
||||
parsoid={
|
||||
"responsiveReferences": { "enabled": true, "threshold": 2 }
|
||||
}
|
||||
!! config
|
||||
wgCiteResponsiveReferences=true
|
||||
wgCiteResponsiveReferencesThreshold=2
|
||||
!! wikitext
|
||||
Test <ref>1</ref><ref>2</ref>
|
||||
<references responsive="0" />
|
||||
|
@ -2319,10 +2393,9 @@ Test <ref>1</ref><ref>2</ref>
|
|||
|
||||
!! test
|
||||
Responsive references: roundtrip templates
|
||||
!! options
|
||||
parsoid={
|
||||
"responsiveReferences": { "enabled": true, "threshold": 2 }
|
||||
}
|
||||
!! config
|
||||
wgCiteResponsiveReferences=true
|
||||
wgCiteResponsiveReferencesThreshold=2
|
||||
!! wikitext
|
||||
test <ref>123</ref>
|
||||
|
||||
|
@ -2533,7 +2606,7 @@ Similarly named refs with identical bodies
|
|||
!! test
|
||||
T220196 - Reference names with high-bit characters, html5 mode
|
||||
!! config
|
||||
wgFragmentMode=['html5']
|
||||
wgFragmentMode=[ "html5" ]
|
||||
!! wikitext
|
||||
<ref name="füllen">[bar]</ref>
|
||||
<references />
|
||||
|
@ -2552,7 +2625,7 @@ wgFragmentMode=['html5']
|
|||
!! test
|
||||
T220196 - Reference names with high-bit characters, legacy mode
|
||||
!! config
|
||||
wgFragmentMode=['legacy']
|
||||
wgFragmentMode=[ "legacy" ]
|
||||
!! wikitext
|
||||
<ref name="füllen">[bar]</ref>
|
||||
<references />
|
||||
|
@ -2598,6 +2671,7 @@ Confusing error
|
|||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt3\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"},\"body\":{\"id\":\"mw-reference-text-cite_note-foo-1\"},\"errors\":[{\"key\":\"cite_error_references_missing_key\",\"params\":[\"foo\"]}]}'><a href=\"./Parser_test#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\"><span class=\"mw-reflink-text\">[1]</span></a></sup>\n"}}'><ol class="mw-references references"><li about="#cite_note-foo-1" id="cite_note-foo-1"><span rel="mw:referencedBy"></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text">foo</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
# T307741: Parsoid fails this test in both standalone and integrated modes.
|
||||
!! test
|
||||
T242437 - Blank ref name in #tag regression
|
||||
!! wikitext
|
||||
|
@ -2609,6 +2683,10 @@ T242437 - Blank ref name in #tag regression
|
|||
</p>
|
||||
!! end
|
||||
|
||||
# While the ref numbering is identical, the ref links with Parsoid's implementation
|
||||
# are different (#cite_ref-3 in Parsoid vs #cite_ref-4). Not sure why the legacy
|
||||
# implementation jumps from #cite_ref-a_2-0 to #cite_ref-4 skipping 3.
|
||||
# Tracked in T307741.
|
||||
!! test
|
||||
T48140 - Make sure rollback/redo does not consume numbers
|
||||
!! wikitext
|
||||
|
@ -2634,8 +2712,18 @@ T48140 - Make sure rollback/redo does not consume numbers
|
|||
<li id="cite_note-4"><span class="mw-cite-backlink"><a href="#cite_ref-4">↑</a></span> <span class="reference-text">should be [2]</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
|
||||
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-a_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a","group":"g"}}'><a href="./Parser_test#cite_note-a-2" style="counter-reset: mw-Ref 1;" data-mw-group="g"><span class="mw-reflink-text">[g 1]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Transclusion" about="#mwt9" data-parsoid='{"group":"g","pi":[[{"k":"1"},{"k":"group","named":true}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:references","function":"tag"},"params":{"1":{"wt":"\n<ref name=\"a\">a</ref>\n"},"group":{"wt":"g"}},"i":0}}]}'><ol class="mw-references references" data-mw-group="g"><li about="#cite_note-a-2" id="cite_note-a-2"><a href="./Parser_test#cite_ref-a_2-0" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-a-2" class="mw-reference-text">a</span></li></ol></div>
|
||||
<p><sup about="#mwt18" class="mw-ref reference" id="cite_ref-3" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-3"}}'><a href="./Parser_test#cite_note-3" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt19" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">should be [1]</span></li><li about="#cite_note-3" id="cite_note-3"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-3" class="mw-reference-text">should be [2]</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
# While the ref numbering is identical, the ref links with Parsoid's implementation
|
||||
# are different (#cite_ref-c_2-0 in Parsoid vs #cite_ref-c_3-0). Not sure why the
|
||||
# legacy implementation jumps from a_1 to c_3 skipping 2 in between.
|
||||
# Tracked in T307741.
|
||||
!! test
|
||||
Numbers in the default group need to start with 1, independent from other groups
|
||||
!! wikitext
|
||||
|
@ -2657,6 +2745,11 @@ Numbers in the default group need to start with 1, independent from other groups
|
|||
<li id="cite_note-c-3"><span class="mw-cite-backlink"><a href="#cite_ref-c_3-0">↑</a></span> <span class="reference-text">c</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! html/parsoid
|
||||
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a","group":"g"}}'><a href="./Parser_test#cite_note-a-1" style="counter-reset: mw-Ref 1;" data-mw-group="g"><span class="mw-reflink-text">[g 1]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Transclusion" about="#mwt6" data-mw='{"parts":[{"template":{"target":{"wt":"#tag:references","function":"tag"},"params":{"1":{"wt":"\n<ref name=\"a\">a</ref>\n"},"group":{"wt":"g"}},"i":0}}]}'><ol class="mw-references references" data-mw-group="g"><li about="#cite_note-a-1" id="cite_note-a-1"><a href="./Parser_test#cite_ref-a_1-0" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text">a</span></li></ol></div>
|
||||
<p><sup about="#mwt15" class="mw-ref reference" id="cite_ref-c_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"c"},"body":{"id":"mw-reference-text-cite_note-c-2"}}'><a href="./Parser_test#cite_note-c-2" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt16" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references"><li about="#cite_note-c-2" id="cite_note-c-2"><a href="./Parser_test#cite_ref-c_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-c-2" class="mw-reference-text">c</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
|
@ -2743,7 +2836,7 @@ Report bad attributes in reference tags
|
|||
!! test
|
||||
Check Cite handing of different types of whitespace in reference names
|
||||
!! config
|
||||
wgFragmentMode=[ 'html5', 'legacy' ]
|
||||
wgFragmentMode=[ "html5", "legacy" ]
|
||||
!! wikitext
|
||||
test space<ref name="a b">testSpaceRef</ref>
|
||||
blah space<ref name="a b" />
|
||||
|
@ -2799,3 +2892,54 @@ b">testLinefeedRef</ref>
|
|||
<p >test linefeed<sup about="#mwt2" class="mw-ref reference" id="cite_ref-a_b_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a b"},"body":{"id":"mw-reference-text-cite_note-a_b-1"}}'><a href="./Parser_test#cite_note-a_b-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-a_b-1" id="cite_note-a_b-1"><a href="./Parser_test#cite_ref-a_b_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-a_b-1" class="mw-reference-text">testLinefeedRef</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
# The legacy parser interrupts the link and adds the link without the <sup> after that.
|
||||
# That behaviour breaks more things in Parsoid, so we hoist the ref link and its sup outside instead.
|
||||
!! test
|
||||
<ref> in a link should hoist the link outside the link (T301293)
|
||||
!! options
|
||||
parsoid={
|
||||
"modes": ["wt2html","selser"]
|
||||
}
|
||||
!! wikitext
|
||||
[[Foo|''x<ref>y</ref>z'']]
|
||||
!! html/parsoid
|
||||
<p><a rel="mw:WikiLink" href="./Foo" title="Foo" class="new" data-parsoid='{"stx":"piped","a":{"href":"./Foo"},"sa":{"href":"Foo"}}'><i>xz</i></a><sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
|
||||
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">y</span></li></ol></div>
|
||||
!! html/php
|
||||
<p><a href="/index.php?title=Foo&action=edit&redlink=1" class="new" title="Foo (page does not exist)"><i>x<sup id="cite_ref-1" class="reference"></sup></i></a><i><a href="#cite_note-1">[1]</a>z</i>
|
||||
</p>
|
||||
<div class="mw-references-wrap"><ol class="references">
|
||||
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">y</span>
|
||||
</li>
|
||||
</ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
Hoisting a reference should not break template continuity
|
||||
!! options
|
||||
parsoid={
|
||||
"modes": ["wt2html","selser"]
|
||||
}
|
||||
!! wikitext
|
||||
{{1x|hello [[Foo|''x<ref>y</ref>z'']] world}}
|
||||
<references />
|
||||
!! html/parsoid
|
||||
<p><span about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"hello [[Foo|''x<ref>y</ref>z'']] world"}},"i":0}}]}'>hello </span><a rel="mw:WikiLink" href="./Foo" title="Foo" about="#mwt2" class="new"><i>xz</i></a><sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>y</ref>"}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;" data-parsoid="{}"><span class="mw-reflink-text" data-parsoid="{}">[1]</span></a></sup><span about="#mwt2"> world</span></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references" data-parsoid="{}"><li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy" data-parsoid="{}"><span class="mw-linkback-text" data-parsoid="{}">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text" data-parsoid="{}">y</span></li></ol></div>
|
||||
!! end
|
||||
|
||||
!! test
|
||||
Hoisting multiple references should keep references in order
|
||||
!! options
|
||||
parsoid={
|
||||
"modes": ["wt2html","selser"]
|
||||
}
|
||||
!! wikitext
|
||||
[[Foo|hello <ref>note 1</ref><ref>note 2</ref>]]<ref>note 3</ref>
|
||||
<references />
|
||||
!! html/parsoid
|
||||
<p data-parsoid='{"dsr":[0,65,0,0]}'><a rel="mw:WikiLink" href="./Foo" title="Foo" class="new" data-parsoid='{"stx":"piped","a":{"href":"./Foo"},"sa":{"href":"Foo"},"dsr":[0,48,6,2]}'>hello </a><sup about="#mwt5" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"dsr":[48,48,null,null],"misnested":true}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;" data-parsoid='{"misnested":true,"dsr":[48,48,null,null]}'><span class="mw-reflink-text" data-parsoid='{"misnested":true,"dsr":[48,48,null,null]}'>[1]</span></a></sup><sup about="#mwt6" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"dsr":[48,48,null,null],"misnested":true}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-2"}}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;" data-parsoid='{"misnested":true,"dsr":[48,48,null,null]}'><span class="mw-reflink-text" data-parsoid='{"misnested":true,"dsr":[48,48,null,null]}'>[2]</span></a></sup><sup about="#mwt4" class="mw-ref reference" id="cite_ref-3" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"dsr":[48,65,5,6]}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-3"}}'><a href="./Parser_test#cite_note-3" style="counter-reset: mw-Ref 3;" data-parsoid="{}"><span class="mw-reflink-text" data-parsoid="{}">[3]</span></a></sup></p>
|
||||
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-parsoid='{"dsr":[66,79,13,0]}' data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references" data-parsoid="{}"><li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy" data-parsoid="{}"><span class="mw-linkback-text" data-parsoid="{}">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text" data-parsoid="{}">note 1</span></li><li about="#cite_note-2" id="cite_note-2" data-parsoid="{}"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy" data-parsoid="{}"><span class="mw-linkback-text" data-parsoid="{}">↑ </span></a> <span id="mw-reference-text-cite_note-2" class="mw-reference-text" data-parsoid="{}">note 2</span></li><li about="#cite_note-3" id="cite_note-3" data-parsoid="{}"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy" data-parsoid="{}"><span class="mw-linkback-text" data-parsoid="{}">↑ </span></a> <span id="mw-reference-text-cite_note-3" class="mw-reference-text" data-parsoid="{}">note 3</span></li></ol></div>
|
||||
!! end
|
||||
|
|
Loading…
Reference in a new issue