| 1 |
!! options |
| 2 |
version=2 |
| 3 |
parsoid-compatible=wt2html,wt2wt,html2wt,html2html,selser |
| 4 |
!! end |
| 5 |
|
| 6 |
# NOTE about Parsoid HTML for cite tests with follows. |
| 7 |
# Parsoid HTML has <sup>s for follows because it needs to be able to roundtrip it back. |
| 8 |
# This output is hidden from read views via CSS in ext.cite.parsoid.styles.less. |
| 9 |
|
| 10 |
# Force the test runner to ensure the extension is loaded |
| 11 |
!! hooks |
| 12 |
ref |
| 13 |
references |
| 14 |
!! endhooks |
| 15 |
|
| 16 |
!! article |
| 17 |
Template:1x |
| 18 |
!! text |
| 19 |
{{{1}}} |
| 20 |
!! endarticle |
| 21 |
|
| 22 |
!! article |
| 23 |
Template:refinref |
| 24 |
!! text |
| 25 |
<ref>{{{1}}}</ref> |
| 26 |
!! endarticle |
| 27 |
|
| 28 |
!! article |
| 29 |
Bolded link |
| 30 |
!! text |
| 31 |
foo |
| 32 |
!! endarticle |
| 33 |
|
| 34 |
!! article |
| 35 |
Foo |
| 36 |
!! text |
| 37 |
foo |
| 38 |
!! endarticle |
| 39 |
|
| 40 |
## Parsoid only drops autoGenerated references lists in rt testing |
| 41 |
!! test |
| 42 |
Simple <ref>, no <references/> |
| 43 |
!! options |
| 44 |
parsoid=wt2html |
| 45 |
!! wikitext |
| 46 |
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref> |
| 47 |
!! html/php |
| 48 |
<p>Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 49 |
</p> |
| 50 |
<div class="mw-references-wrap"><ol class="references"> |
| 51 |
<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> |
| 52 |
</li> |
| 53 |
</ol></div> |
| 54 |
!! html/parsoid |
| 55 |
<p>Wikipedia rocks!<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> |
| 56 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">Proceeds of Rockology, vol. XXI</span></li></ol></div> |
| 57 |
!! end |
| 58 |
|
| 59 |
!! test |
| 60 |
Simple <ref>, no <references/>, page ends in a list |
| 61 |
!! options |
| 62 |
parsoid=wt2html |
| 63 |
!! wikitext |
| 64 |
blah<ref>foo</ref> --Matma Rex 17:35, 31 March 2020 (UTC) |
| 65 |
* bleh --Matma Rex 17:35, 31 March 2020 (UTC) |
| 66 |
!! html |
| 67 |
<p>blah<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> --Matma Rex 17:35, 31 March 2020 (UTC) |
| 68 |
</p> |
| 69 |
<ul><li>bleh --Matma Rex 17:35, 31 March 2020 (UTC)</li></ul> |
| 70 |
<div class="mw-references-wrap"><ol class="references"> |
| 71 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">foo</span> |
| 72 |
</li> |
| 73 |
</ol></div> |
| 74 |
!! html/parsoid |
| 75 |
<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> |
| 76 |
<ul><li>bleh --Matma Rex 17:35, 31 March 2020 (UTC)</li></ul> |
| 77 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 78 |
!! end |
| 79 |
|
| 80 |
!! test |
| 81 |
Simple <ref>, with <references/> |
| 82 |
!! wikitext |
| 83 |
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref> |
| 84 |
|
| 85 |
<references /> |
| 86 |
!! html/php |
| 87 |
<p>Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 88 |
</p> |
| 89 |
<div class="mw-references-wrap"><ol class="references"> |
| 90 |
<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> |
| 91 |
</li> |
| 92 |
</ol></div> |
| 93 |
!! html/parsoid |
| 94 |
<p>Wikipedia rocks!<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> |
| 95 |
|
| 96 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">Proceeds of Rockology, vol. XXI</span></li></ol></div> |
| 97 |
!! end |
| 98 |
|
| 99 |
!! article |
| 100 |
Template:Simple template |
| 101 |
!! text |
| 102 |
A ''simple'' template. |
| 103 |
!! endarticle |
| 104 |
|
| 105 |
|
| 106 |
!! test |
| 107 |
<ref> with a simple template |
| 108 |
!! wikitext |
| 109 |
Templating<ref>{{simple template}}</ref> |
| 110 |
|
| 111 |
<references /> |
| 112 |
!! html/php |
| 113 |
<p>Templating<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 114 |
</p> |
| 115 |
<div class="mw-references-wrap"><ol class="references"> |
| 116 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">A <i>simple</i> template.</span> |
| 117 |
</li> |
| 118 |
</ol></div> |
| 119 |
!! html/parsoid |
| 120 |
<p>Templating<sup about="#mwt4" 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> |
| 121 |
|
| 122 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"><span about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"simple template","href":"./Template:Simple_template"},"params":{},"i":0}}]}'>A </span><i about="#mwt2">simple</i><span about="#mwt2"> template.</span></span></li></ol></div> |
| 123 |
!! end |
| 124 |
|
| 125 |
!! test |
| 126 |
<ref> with a <nowiki> |
| 127 |
!! wikitext |
| 128 |
Templating<ref><nowiki>{{simple template}}</nowiki></ref> |
| 129 |
|
| 130 |
<references /> |
| 131 |
!! html/php |
| 132 |
<p>Templating<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 133 |
</p> |
| 134 |
<div class="mw-references-wrap"><ol class="references"> |
| 135 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">{{simple template}}</span> |
| 136 |
</li> |
| 137 |
</ol></div> |
| 138 |
!! html/parsoid |
| 139 |
<p>Templating<sup about="#mwt5" 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> |
| 140 |
|
| 141 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">{{simple template}}</span></li></ol></div> |
| 142 |
!! end |
| 143 |
|
| 144 |
|
| 145 |
!! test |
| 146 |
<ref> in a <nowiki> |
| 147 |
!! wikitext |
| 148 |
Templating<nowiki><ref>{{simple template}}</ref></nowiki> |
| 149 |
|
| 150 |
<references /> |
| 151 |
!! html |
| 152 |
<p>Templating<ref>{{simple template}}</ref> |
| 153 |
</p><p><br /> |
| 154 |
</p> |
| 155 |
!! html/parsoid |
| 156 |
<p>Templating<span typeof="mw:Nowiki"><ref>{{simple template}}</ref></span></p> |
| 157 |
|
| 158 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div> |
| 159 |
!! end |
| 160 |
|
| 161 |
!! test |
| 162 |
<ref> in a <!--comment--> |
| 163 |
!! wikitext |
| 164 |
Templating<!--<ref>{{simple template}}</ref>--> |
| 165 |
|
| 166 |
<references /> |
| 167 |
!! html |
| 168 |
<p>Templating |
| 169 |
</p><p><br /> |
| 170 |
</p> |
| 171 |
!! html/parsoid |
| 172 |
<p>Templating</p><!--<ref>{{simple template}}</ref>--> |
| 173 |
|
| 174 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div> |
| 175 |
!! end |
| 176 |
|
| 177 |
!! test |
| 178 |
<!--comment--> in a <ref> (T7384) |
| 179 |
!! wikitext |
| 180 |
Templating<ref>Text<!--comment--></ref> |
| 181 |
|
| 182 |
<references /> |
| 183 |
!! html/php |
| 184 |
<p>Templating<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 185 |
</p> |
| 186 |
<div class="mw-references-wrap"><ol class="references"> |
| 187 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Text</span> |
| 188 |
</li> |
| 189 |
</ol></div> |
| 190 |
!! html/parsoid |
| 191 |
<p>Templating<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></p> |
| 192 |
|
| 193 |
<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-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">Text<!--comment--></span></li></ol></div> |
| 194 |
!! end |
| 195 |
|
| 196 |
!! test |
| 197 |
<ref> in an ignored caption (T235656) |
| 198 |
!! config |
| 199 |
wgParserEnableLegacyMediaDOM=false |
| 200 |
!! wikitext |
| 201 |
[[File:Foobar.jpg|frameless|ignored caption with a ref<ref>boo</ref>]] |
| 202 |
|
| 203 |
<references /> |
| 204 |
!! html/php |
| 205 |
<p><span class="mw-default-size" typeof="mw:File/Frameless"><a href="/wiki/File:Foobar.jpg" class="mw-file-description" title="ignored caption with a ref[1]"><img alt="ignored caption with a ref[1]" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="mw-file-element" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a></span> |
| 206 |
</p> |
| 207 |
<div class="mw-references-wrap"><ol class="references"> |
| 208 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">boo</span> |
| 209 |
</li> |
| 210 |
</ol></div> |
| 211 |
!! html/parsoid |
| 212 |
<p><span class="mw-default-size" typeof="mw:File/Frameless" data-parsoid='{"optList":[{"ck":"frameless","ak":"frameless"},{"ck":"caption","ak":"ignored caption with a ref<ref>boo</ref>"}]}' data-mw='{"caption":"ignored caption with a ref<sup about=\"#mwt2\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[54,68,5,6]}' 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>"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="ignored caption with a ref"><img alt="ignored caption with a ref" resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" class="mw-file-element"/></a></span></p> |
| 213 |
|
| 214 |
<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-1" id="cite_note-1"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">boo</span></li></ol></div> |
| 215 |
!! end |
| 216 |
|
| 217 |
!! test |
| 218 |
<ref> in expanded attributes of tags (legitimate or otherwise) |
| 219 |
!! options |
| 220 |
parsoid=wt2html,wt2wt |
| 221 |
!! wikitext |
| 222 |
{| |
| 223 |
|- <ref>boo</ref> |
| 224 |
|x |
| 225 |
|} |
| 226 |
<references /> |
| 227 |
!! html/php |
| 228 |
<table> |
| 229 |
|
| 230 |
<tbody><tr id="cite_ref-1" class="cite-bracket"> |
| 231 |
<td>x |
| 232 |
</td></tr></tbody></table> |
| 233 |
<div class="mw-references-wrap"><ol class="references"> |
| 234 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">boo</span> |
| 235 |
</li> |
| 236 |
</ol></div> |
| 237 |
!! html/parsoid |
| 238 |
<table> |
| 239 |
<tbody><tr about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"startTagSrc":"|-","a":{"<ref>boo</ref>":null},"sa":{"<ref>boo</ref>":""}}' data-mw='{"attribs":[[{"txt":"","html":"<sup about=\"#mwt2\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[6,20,5,6]}' 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>"},{"html":""}]]}'> |
| 240 |
<td>x</td></tr> |
| 241 |
</tbody></table> |
| 242 |
<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"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">boo</span></li></ol></div> |
| 243 |
!! end |
| 244 |
|
| 245 |
!! test |
| 246 |
<ref>s in language variant markup |
| 247 |
!! options |
| 248 |
language=sr htmlVariantLanguage=sr-Cyrl |
| 249 |
!! wikitext |
| 250 |
-{lj <ref>a</ref>}-аб-{nj <ref name="y">b</ref>}-вг-{dž}- c <ref name="y" /> |
| 251 |
<references /> |
| 252 |
!! html/php |
| 253 |
<p>lj <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>абnj <sup id="cite_ref-y_2-0" class="reference"><a href="#cite_note-y-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>вгdž ц <sup id="cite_ref-y_2-1" class="reference"><a href="#cite_note-y-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 254 |
</p> |
| 255 |
<div class="mw-references-wrap"><ol class="references"> |
| 256 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">а</span> |
| 257 |
</li> |
| 258 |
<li id="cite_note-y-2"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-y_2-0">2,0</a></sup> <sup><a href="#cite_ref-y_2-1">2,1</a></sup></span> <span class="reference-text">б</span> |
| 259 |
</li> |
| 260 |
</ol></div> |
| 261 |
!! html/parsoid |
| 262 |
<p><span typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"lj <sup about=\"#mwt7\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[5,17,5,6]}' 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>аб<span typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"nj <sup about=\"#mwt8\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[28,49,14,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"y\"},\"body\":{\"id\":\"mw-reference-text-cite_note-y-2\"}}'><a href=\"./Parser_test#cite_note-y-2\" style=\"counter-reset: mw-Ref 2;\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[2]</span></a></sup>"}}'></span>вг<span typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"dž"}}'></span> c <sup about="#mwt6" class="mw-ref reference" id="cite_ref-y_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"y"}}'><a href="./Parser_test#cite_note-y-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 263 |
<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"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">a</span></li><li about="#cite_note-y-2" id="cite_note-y-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-y_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-y-2" class="mw-reference-text reference-text">b</span></li></ol></div> |
| 264 |
!! end |
| 265 |
|
| 266 |
!! test |
| 267 |
<references> after <gallery> (bug 6164) |
| 268 |
!! options |
| 269 |
parsoid=wt2html,html2html |
| 270 |
!! config |
| 271 |
wgParserEnableLegacyMediaDOM=false |
| 272 |
!! wikitext |
| 273 |
<ref>one</ref> |
| 274 |
|
| 275 |
<gallery>Image:Foobar.jpg</gallery> |
| 276 |
|
| 277 |
<references /> |
| 278 |
!! html/php |
| 279 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 280 |
</p> |
| 281 |
<ul class="gallery mw-gallery-traditional"> |
| 282 |
<li class="gallerybox" style="width: 155px"> |
| 283 |
<div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="/wiki/File:Foobar.jpg" class="mw-file-description"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" class="mw-file-element" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></span></div> |
| 284 |
<div class="gallerytext"></div> |
| 285 |
</li> |
| 286 |
</ul> |
| 287 |
<div class="mw-references-wrap"><ol class="references"> |
| 288 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">one</span> |
| 289 |
</li> |
| 290 |
</ol></div> |
| 291 |
!! html/parsoid |
| 292 |
<p><sup about="#mwt4" 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> |
| 293 |
|
| 294 |
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt9" data-mw='{"name":"gallery","attrs":{},"body":{}}'> |
| 295 |
<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span typeof="mw:File"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" class="mw-file-element"/></a></span></div><div class="gallerytext"></div></li> |
| 296 |
</ul> |
| 297 |
|
| 298 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">one</span></li></ol></div> |
| 299 |
!! end |
| 300 |
|
| 301 |
!! test |
| 302 |
{{REVISIONID}} on page with <ref> (bug 6299) |
| 303 |
!! wikitext |
| 304 |
{{REVISIONID}}<ref>elite</ref> |
| 305 |
!! html |
| 306 |
<p>1337<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 307 |
</p> |
| 308 |
<div class="mw-references-wrap"><ol class="references"> |
| 309 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">elite</span> |
| 310 |
</li> |
| 311 |
</ol></div> |
| 312 |
!! html/parsoid |
| 313 |
<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> |
| 314 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">elite</span></li></ol></div> |
| 315 |
!! end |
| 316 |
|
| 317 |
!! test |
| 318 |
{{REVISIONID}} on page without <ref> (bug 6299 sanity check) |
| 319 |
!! wikitext |
| 320 |
{{REVISIONID}} |
| 321 |
!! html |
| 322 |
<p>1337 |
| 323 |
</p> |
| 324 |
!! html/parsoid |
| 325 |
<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> |
| 326 |
!! end |
| 327 |
|
| 328 |
!! test |
| 329 |
Ref with content followed by blank ref |
| 330 |
!! wikitext |
| 331 |
<ref name="blank">content</ref> |
| 332 |
|
| 333 |
<ref name="blank" /> |
| 334 |
|
| 335 |
<references /> |
| 336 |
!! html/php |
| 337 |
<p><sup id="cite_ref-blank_1-0" class="reference"><a href="#cite_note-blank-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 338 |
</p><p><sup id="cite_ref-blank_1-1" class="reference"><a href="#cite_note-blank-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 339 |
</p> |
| 340 |
<div class="mw-references-wrap"><ol class="references"> |
| 341 |
<li id="cite_note-blank-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-blank_1-0">1.0</a></sup> <sup><a href="#cite_ref-blank_1-1">1.1</a></sup></span> <span class="reference-text">content</span> |
| 342 |
</li> |
| 343 |
</ol></div> |
| 344 |
!! html/parsoid |
| 345 |
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-blank_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"blank"},"body":{"id":"mw-reference-text-cite_note-blank-1"}}'><a href="./Parser_test#cite_note-blank-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 346 |
|
| 347 |
<p><sup about="#mwt6" class="mw-ref reference" id="cite_ref-blank_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"blank"}}'><a href="./Parser_test#cite_note-blank-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 348 |
|
| 349 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-blank-1" id="cite_note-blank-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-blank_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-blank_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-blank-1" class="mw-reference-text reference-text">content</span></li></ol></div> |
| 350 |
!! end |
| 351 |
|
| 352 |
!! test |
| 353 |
Blank ref followed by ref with content |
| 354 |
!! wikitext |
| 355 |
<ref name="blank" /> |
| 356 |
|
| 357 |
<ref name="blank">content</ref> |
| 358 |
|
| 359 |
<references /> |
| 360 |
!! html/php |
| 361 |
<p><sup id="cite_ref-blank_1-0" class="reference"><a href="#cite_note-blank-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 362 |
</p><p><sup id="cite_ref-blank_1-1" class="reference"><a href="#cite_note-blank-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 363 |
</p> |
| 364 |
<div class="mw-references-wrap"><ol class="references"> |
| 365 |
<li id="cite_note-blank-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-blank_1-0">1.0</a></sup> <sup><a href="#cite_ref-blank_1-1">1.1</a></sup></span> <span class="reference-text">content</span> |
| 366 |
</li> |
| 367 |
</ol></div> |
| 368 |
!! html/parsoid |
| 369 |
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-blank_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"blank"}}'><a href="./Parser_test#cite_note-blank-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 370 |
|
| 371 |
<p><sup about="#mwt6" class="mw-ref reference" id="cite_ref-blank_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"blank"},"body":{"id":"mw-reference-text-cite_note-blank-1"}}'><a href="./Parser_test#cite_note-blank-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 372 |
|
| 373 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-blank-1" id="cite_note-blank-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-blank_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-blank_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-blank-1" class="mw-reference-text reference-text">content</span></li></ol></div> |
| 374 |
!! end |
| 375 |
|
| 376 |
!! test |
| 377 |
Regression: non-blank ref "0" followed by ref with content |
| 378 |
!! wikitext |
| 379 |
<ref name="blank">0</ref> |
| 380 |
|
| 381 |
<ref name="blank">content</ref> |
| 382 |
|
| 383 |
<references /> |
| 384 |
!! html/php |
| 385 |
<p><sup id="cite_ref-blank_1-0" class="reference"><a href="#cite_note-blank-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 386 |
</p><p><sup id="cite_ref-blank_1-1" class="reference"><a href="#cite_note-blank-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 387 |
</p> |
| 388 |
<div class="mw-references-wrap"><ol class="references"> |
| 389 |
<li id="cite_note-blank-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-blank_1-0">1.0</a></sup> <sup><a href="#cite_ref-blank_1-1">1.1</a></sup></span> <span class="reference-text">0 <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name "blank" defined multiple times with different content</span></span> |
| 390 |
</li> |
| 391 |
</ol></div> |
| 392 |
!! html/parsoid |
| 393 |
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-blank_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"blank"},"body":{"id":"mw-reference-text-cite_note-blank-1"}}'><a href="./Parser_test#cite_note-blank-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 394 |
|
| 395 |
<p><sup about="#mwt6" class="mw-ref reference" id="cite_ref-blank_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"blank"},"body":{"html":"content"},"errors":[{"key":"cite_error_references_duplicate_key","params":["blank"]}]}'><a href="./Parser_test#cite_note-blank-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 396 |
|
| 397 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-blank-1" id="cite_note-blank-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-blank_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-blank_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-blank-1" class="mw-reference-text reference-text">0</span></li></ol></div> |
| 398 |
!! end |
| 399 |
|
| 400 |
!! test |
| 401 |
Regression sanity check: non-blank ref "1" followed by ref with content |
| 402 |
!! wikitext |
| 403 |
<ref name="blank">1</ref> |
| 404 |
|
| 405 |
<ref name="blank">content</ref> |
| 406 |
|
| 407 |
<references /> |
| 408 |
!! html/php |
| 409 |
<p><sup id="cite_ref-blank_1-0" class="reference"><a href="#cite_note-blank-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 410 |
</p><p><sup id="cite_ref-blank_1-1" class="reference"><a href="#cite_note-blank-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 411 |
</p> |
| 412 |
<div class="mw-references-wrap"><ol class="references"> |
| 413 |
<li id="cite_note-blank-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-blank_1-0">1.0</a></sup> <sup><a href="#cite_ref-blank_1-1">1.1</a></sup></span> <span class="reference-text">1 <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name "blank" defined multiple times with different content</span></span> |
| 414 |
</li> |
| 415 |
</ol></div> |
| 416 |
!! html/parsoid |
| 417 |
<p><sup about="#mwt3" class="mw-ref reference" id="cite_ref-blank_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"blank"},"body":{"id":"mw-reference-text-cite_note-blank-1"}}'><a href="./Parser_test#cite_note-blank-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 418 |
|
| 419 |
<p><sup about="#mwt6" class="mw-ref reference" id="cite_ref-blank_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"blank"},"body":{"html":"content"},"errors":[{"key":"cite_error_references_duplicate_key","params":["blank"]}]}'><a href="./Parser_test#cite_note-blank-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 420 |
|
| 421 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-blank-1" id="cite_note-blank-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-blank_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-blank_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-blank-1" class="mw-reference-text reference-text">1</span></li></ol></div> |
| 422 |
!! end |
| 423 |
|
| 424 |
!! test |
| 425 |
Ref names containing a number |
| 426 |
!! wikitext |
| 427 |
<ref name="test123test">One</ref> |
| 428 |
<ref name="123test">Two</ref> |
| 429 |
<ref name="test123">Three</ref> |
| 430 |
|
| 431 |
<references /> |
| 432 |
!! html |
| 433 |
<p><sup id="cite_ref-test123test_1-0" class="reference"><a href="#cite_note-test123test-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 434 |
<sup id="cite_ref-123test_2-0" class="reference"><a href="#cite_note-123test-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 435 |
<sup id="cite_ref-test123_3-0" class="reference"><a href="#cite_note-test123-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> |
| 436 |
</p> |
| 437 |
<div class="mw-references-wrap"><ol class="references"> |
| 438 |
<li id="cite_note-test123test-1"><span class="mw-cite-backlink"><a href="#cite_ref-test123test_1-0">↑</a></span> <span class="reference-text">One</span> |
| 439 |
</li> |
| 440 |
<li id="cite_note-123test-2"><span class="mw-cite-backlink"><a href="#cite_ref-123test_2-0">↑</a></span> <span class="reference-text">Two</span> |
| 441 |
</li> |
| 442 |
<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> |
| 443 |
</li> |
| 444 |
</ol></div> |
| 445 |
!! html/parsoid |
| 446 |
<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> |
| 447 |
<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> |
| 448 |
<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> |
| 449 |
|
| 450 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-test123test_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-test123test-1" class="mw-reference-text reference-text">One</span></li><li about="#cite_note-123test-2" id="cite_note-123test-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-123test_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-123test-2" class="mw-reference-text reference-text">Two</span></li><li about="#cite_note-test123-3" id="cite_note-test123-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-test123_3-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-test123-3" class="mw-reference-text reference-text">Three</span></li></ol></div> |
| 451 |
!! end |
| 452 |
|
| 453 |
## Note that the underscores are normalized in the id only and these remain |
| 454 |
## separate names (T184912#4758775) |
| 455 |
!! test |
| 456 |
T184912: Consistent normalization of consecutive underscores |
| 457 |
!! wikitext |
| 458 |
<ref name="test_123">example</ref> |
| 459 |
<ref name="test__123">example</ref> |
| 460 |
<references /> |
| 461 |
!! html/php |
| 462 |
<p><sup id="cite_ref-test_123_1-0" class="reference"><a href="#cite_note-test_123-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 463 |
<sup id="cite_ref-test_123_2-0" class="reference"><a href="#cite_note-test_123-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 464 |
</p> |
| 465 |
<div class="mw-references-wrap"><ol class="references"> |
| 466 |
<li id="cite_note-test_123-1"><span class="mw-cite-backlink"><a href="#cite_ref-test_123_1-0">↑</a></span> <span class="reference-text">example</span> |
| 467 |
</li> |
| 468 |
<li id="cite_note-test_123-2"><span class="mw-cite-backlink"><a href="#cite_ref-test_123_2-0">↑</a></span> <span class="reference-text">example</span> |
| 469 |
</li> |
| 470 |
</ol></div> |
| 471 |
!! html/parsoid |
| 472 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-test_123_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"test_123"},"body":{"id":"mw-reference-text-cite_note-test_123-1"}}'><a href="./Parser_test#cite_note-test_123-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 473 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-test_123_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"test__123"},"body":{"id":"mw-reference-text-cite_note-test_123-2"}}'><a href="./Parser_test#cite_note-test_123-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 474 |
<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-test_123-1" id="cite_note-test_123-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-test_123_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-test_123-1" class="mw-reference-text reference-text">example</span></li><li about="#cite_note-test_123-2" id="cite_note-test_123-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-test_123_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-test_123-2" class="mw-reference-text reference-text">example</span></li></ol></div> |
| 475 |
!! end |
| 476 |
|
| 477 |
!! test |
| 478 |
Erroneous refs |
| 479 |
!! wikitext |
| 480 |
<ref name="0">Zero</ref> |
| 481 |
|
| 482 |
<ref>Also zero, but differently! (Normal ref)</ref> |
| 483 |
|
| 484 |
<ref /> |
| 485 |
|
| 486 |
<ref name="foo" name="bar" /> |
| 487 |
|
| 488 |
<ref name="blankwithnoreference" /> |
| 489 |
|
| 490 |
<references name="quasit" /> |
| 491 |
|
| 492 |
<references /> |
| 493 |
!! html/php |
| 494 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name cannot be a simple integer. Use a descriptive title</span> |
| 495 |
</p><p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 496 |
</p><p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: The opening <code><ref></code> tag is malformed or has a bad name</span> |
| 497 |
</p><p><sup id="cite_ref-bar_2-0" class="reference"><a href="#cite_note-bar-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 498 |
</p><p><sup id="cite_ref-blankwithnoreference_3-0" class="reference"><a href="#cite_note-blankwithnoreference-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> |
| 499 |
</p><p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code><references></code> tag</span> |
| 500 |
</p> |
| 501 |
<div class="mw-references-wrap"><ol class="references"> |
| 502 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Also zero, but differently! (Normal ref)</span> |
| 503 |
</li> |
| 504 |
<li id="cite_note-bar-2"><span class="mw-cite-backlink"><a href="#cite_ref-bar_2-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>bar</code></span></li> |
| 505 |
<li id="cite_note-blankwithnoreference-3"><span class="mw-cite-backlink"><a href="#cite_ref-blankwithnoreference_3-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>blankwithnoreference</code></span></li> |
| 506 |
</ol></div> |
| 507 |
!! html/parsoid |
| 508 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-0_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"0"},"body":{"id":"mw-reference-text-cite_note-0-1"},"errors":[{"key":"cite_error_ref_numeric_key"}]}'><a href="./Parser_test#cite_note-0-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 509 |
|
| 510 |
<p><sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 511 |
|
| 512 |
<p><sup about="#mwt6" class="mw-ref reference" id="cite_ref-3" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{},"errors":[{"key":"cite_error_ref_no_key"}]}'><a href="./Parser_test#cite_note-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 513 |
|
| 514 |
<p><sup about="#mwt8" class="mw-ref reference" id="cite_ref-bar_4-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"bar"},"errors":[{"key":"cite_error_references_no_text","params":["bar"]}]}'><a href="./Parser_test#cite_note-bar-4" style="counter-reset: mw-Ref 4;"><span class="mw-reflink-text">[4]</span></a></sup></p> |
| 515 |
|
| 516 |
<p><sup about="#mwt10" class="mw-ref reference" id="cite_ref-blankwithnoreference_5-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"blankwithnoreference"},"errors":[{"key":"cite_error_references_no_text","params":["blankwithnoreference"]}]}'><a href="./Parser_test#cite_note-blankwithnoreference-5" style="counter-reset: mw-Ref 5;"><span class="mw-reflink-text">[5]</span></a></sup></p> |
| 517 |
|
| 518 |
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Error" data-mw='{"name":"references","attrs":{"name":"quasit"},"errors":[{"key":"cite_error_references_invalid_parameters"}]}'><ol class="mw-references references"><li about="#cite_note-0-1" id="cite_note-0-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-0_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-0-1" class="mw-reference-text reference-text">Zero</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">Also zero, but differently! (Normal ref)</span></li><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text"></span></li><li about="#cite_note-bar-4" id="cite_note-bar-4"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-bar_4-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-bar-4" class="mw-reference-text reference-text"></span></li><li about="#cite_note-blankwithnoreference-5" id="cite_note-blankwithnoreference-5"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-blankwithnoreference_5-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-blankwithnoreference-5" class="mw-reference-text reference-text"></span></li></ol></div> |
| 519 |
|
| 520 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div> |
| 521 |
!! end |
| 522 |
|
| 523 |
!! test |
| 524 |
Can't have name="…" and follow="…" the same time |
| 525 |
!! wikitext |
| 526 |
<ref name="theName" follow="theFollows">theValue</ref> |
| 527 |
<references /> |
| 528 |
!! html/php |
| 529 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: A <code><ref follow="…"></code> tag that is the continuation of a previous one can neither be named individually nor extended</span> |
| 530 |
</p> |
| 531 |
!! html/parsoid |
| 532 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-theName_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"theName","follow":"theFollows"},"body":{"id":"mw-reference-text-cite_note-theName-1"},"errors":[{"key":"cite_error_ref_follow_conflicts"}]}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 533 |
<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-theName-1" id="cite_note-theName-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName-1" class="mw-reference-text reference-text"><span typeof="mw:Cite/Follow" about="#mwt2"> theValue</span></span></li></ol></div> |
| 534 |
!! end |
| 535 |
|
| 536 |
!! test |
| 537 |
Conflicting name="…" and follow="…" together with another invalid parameter |
| 538 |
!! wikitext |
| 539 |
<ref name="theName" follow="theFollows" dummy="dummy">theValue</ref> |
| 540 |
<references /> |
| 541 |
!! html/php |
| 542 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code><ref></code> tag</span> |
| 543 |
</p> |
| 544 |
!! html/parsoid |
| 545 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-theName_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"theName","follow":"theFollows","dummy":"dummy"},"body":{"id":"mw-reference-text-cite_note-theName-1"},"errors":[{"key":"cite_error_ref_follow_conflicts"}]}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 546 |
<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-theName-1" id="cite_note-theName-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName-1" class="mw-reference-text reference-text"><span typeof="mw:Cite/Follow" about="#mwt2"> theValue</span></span></li></ol></div> |
| 547 |
!! end |
| 548 |
|
| 549 |
!! test |
| 550 |
It's not possible to follow="…" a <ref> defined in the <references> section |
| 551 |
!! wikitext |
| 552 |
<ref follow="theName">theFollows</ref> |
| 553 |
<references> |
| 554 |
<ref name="theName">theValue</ref> |
| 555 |
</references> |
| 556 |
!! html/php |
| 557 |
<div class="mw-references-wrap"><ol class="references"> |
| 558 |
<p id="cite_note-theName"><span class="reference-text">theFollows</span> |
| 559 |
</p> |
| 560 |
</ol></div> |
| 561 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag with name "theName" defined in <code><references></code> is not used in prior text.</span> |
| 562 |
</p> |
| 563 |
!! html/parsoid |
| 564 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"follow":"theName"},"body":{"id":"mw-reference-text-cite_note-1"},"errors":[{"key":"cite_error_references_missing_key","params":["theName"]}]}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 565 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt5\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"theName\"},\"body\":{\"id\":\"mw-reference-text-cite_note-theName-2\"},\"errors\":[{\"key\":\"cite_error_references_missing_key\",\"params\":[\"theName\"]}]}'><a href=\"./Parser_test#cite_note-theName-2\" style=\"counter-reset: mw-Ref 2;\"><span class=\"mw-reflink-text\">[2]</span></a></sup>\n"}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"><span typeof="mw:Cite/Follow" about="#mwt2"> theFollows</span></span></li><li about="#cite_note-theName-2" id="cite_note-theName-2"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-theName-2" class="mw-reference-text reference-text">theValue</span></li></ol></div> |
| 566 |
!! end |
| 567 |
|
| 568 |
## Note that the Cite extension of the legacy parser is putting paragraphs |
| 569 |
## as direct descendents of ordered lists (instead of inside list items, |
| 570 |
## or wherehaveyou) |
| 571 |
!! test |
| 572 |
A follow="…" before its parent is not merged |
| 573 |
!! wikitext |
| 574 |
<ref follow="theName">''theFollows''</ref> |
| 575 |
<ref name="theName">''theValue''</ref> |
| 576 |
<references /> |
| 577 |
!! html/php |
| 578 |
<p><sup id="cite_ref-theName_2-0" class="reference"><a href="#cite_note-theName-2"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 579 |
</p> |
| 580 |
<div class="mw-references-wrap"><ol class="references"> |
| 581 |
<p id="cite_note-theName"><span class="reference-text"><i>theFollows</i></span> |
| 582 |
</p> |
| 583 |
<li id="cite_note-theName-2"><span class="mw-cite-backlink"><a href="#cite_ref-theName_2-0">↑</a></span> <span class="reference-text"><i>theValue</i></span> |
| 584 |
</li> |
| 585 |
</ol></div> |
| 586 |
!! html/parsoid |
| 587 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"follow":"theName"},"body":{"id":"mw-reference-text-cite_note-1"},"errors":[{"key":"cite_error_references_missing_key","params":["theName"]}]}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 588 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-theName_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-2"}}'><a href="./Parser_test#cite_note-theName-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 589 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"><span typeof="mw:Cite/Follow" about="#mwt2"> <i>theFollows</i></span></span></li><li about="#cite_note-theName-2" id="cite_note-theName-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName-2" class="mw-reference-text reference-text"><i>theValue</i></span></li></ol></div> |
| 590 |
!! end |
| 591 |
|
| 592 |
## This is a nasty edge case which was dropping the ref entirely from the |
| 593 |
## output of the Cite extension of the legacy parser |
| 594 |
!! test |
| 595 |
"follow" after a named ref but before its parent |
| 596 |
!! wikitext |
| 597 |
<ref name="first">First</ref> |
| 598 |
<ref follow="third">Second</ref> |
| 599 |
<ref name="third">Third</ref> |
| 600 |
<hr /> |
| 601 |
<references /> |
| 602 |
!! html/php |
| 603 |
<p><sup id="cite_ref-first_1-0" class="reference"><a href="#cite_note-first-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 604 |
</p><p><sup id="cite_ref-third_3-0" class="reference"><a href="#cite_note-third-3"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 605 |
</p> |
| 606 |
<hr /> |
| 607 |
<div class="mw-references-wrap"><ol class="references"> |
| 608 |
<p id="cite_note-third"><span class="reference-text">Second</span> |
| 609 |
</p> |
| 610 |
<li id="cite_note-first-1"><span class="mw-cite-backlink"><a href="#cite_ref-first_1-0">↑</a></span> <span class="reference-text">First</span> |
| 611 |
</li> |
| 612 |
<li id="cite_note-third-3"><span class="mw-cite-backlink"><a href="#cite_ref-third_3-0">↑</a></span> <span class="reference-text">Third</span> |
| 613 |
</li> |
| 614 |
</ol></div> |
| 615 |
!! html/parsoid |
| 616 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-first_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"first"},"body":{"id":"mw-reference-text-cite_note-first-1"}}'><a href="./Parser_test#cite_note-first-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 617 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"follow":"third"},"body":{"id":"mw-reference-text-cite_note-2"},"errors":[{"key":"cite_error_references_missing_key","params":["third"]}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 618 |
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-third_3-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"third"},"body":{"id":"mw-reference-text-cite_note-third-3"}}'><a href="./Parser_test#cite_note-third-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 619 |
<hr data-parsoid='{"stx":"html","selfClose":true}'/> |
| 620 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-first-1" id="cite_note-first-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-first_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-first-1" class="mw-reference-text reference-text">First</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text"><span typeof="mw:Cite/Follow" about="#mwt4"> Second</span></span></li><li about="#cite_note-third-3" id="cite_note-third-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-third_3-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-third-3" class="mw-reference-text reference-text">Third</span></li></ol></div> |
| 621 |
!! end |
| 622 |
|
| 623 |
!! test |
| 624 |
"follow" after an anonymous ref but before its parent |
| 625 |
!! wikitext |
| 626 |
<ref>First</ref> |
| 627 |
<ref follow="third">Second</ref> |
| 628 |
<ref name="third">Third</ref> |
| 629 |
<hr /> |
| 630 |
<references /> |
| 631 |
!! html/php |
| 632 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 633 |
</p><p><sup id="cite_ref-third_3-0" class="reference"><a href="#cite_note-third-3"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 634 |
</p> |
| 635 |
<hr /> |
| 636 |
<div class="mw-references-wrap"><ol class="references"> |
| 637 |
<p id="cite_note-third"><span class="reference-text">Second</span> |
| 638 |
</p> |
| 639 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">First</span> |
| 640 |
</li> |
| 641 |
<li id="cite_note-third-3"><span class="mw-cite-backlink"><a href="#cite_ref-third_3-0">↑</a></span> <span class="reference-text">Third</span> |
| 642 |
</li> |
| 643 |
</ol></div> |
| 644 |
!! html/parsoid |
| 645 |
<p><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> |
| 646 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"follow":"third"},"body":{"id":"mw-reference-text-cite_note-2"},"errors":[{"key":"cite_error_references_missing_key","params":["third"]}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 647 |
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-third_3-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"third"},"body":{"id":"mw-reference-text-cite_note-third-3"}}'><a href="./Parser_test#cite_note-third-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 648 |
<hr data-parsoid='{"stx":"html","selfClose":true}'/> |
| 649 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">First</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text"><span typeof="mw:Cite/Follow" about="#mwt4"> Second</span></span></li><li about="#cite_note-third-3" id="cite_note-third-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-third_3-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-third-3" class="mw-reference-text reference-text">Third</span></li></ol></div> |
| 650 |
!! end |
| 651 |
|
| 652 |
!! test |
| 653 |
Valid follow="…" after it's parent |
| 654 |
!! wikitext |
| 655 |
<ref name="theName">theValue</ref> |
| 656 |
<ref follow="theName">theFollows</ref> |
| 657 |
<ref>Should be 2</ref> |
| 658 |
<references /> |
| 659 |
!! html/php |
| 660 |
<p><sup id="cite_ref-theName_1-0" class="reference"><a href="#cite_note-theName-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 661 |
</p><p><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 662 |
</p> |
| 663 |
<div class="mw-references-wrap"><ol class="references"> |
| 664 |
<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 theFollows</span> |
| 665 |
</li> |
| 666 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">Should be 2</span> |
| 667 |
</li> |
| 668 |
</ol></div> |
| 669 |
!! html/parsoid |
| 670 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-theName_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-1"}}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 671 |
<sup about="#mwt4" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"follow":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-1"}}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 672 |
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 673 |
<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-theName-1" id="cite_note-theName-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName-1" class="mw-reference-text reference-text">theValue<span typeof="mw:Cite/Follow" about="#mwt4"> theFollows</span></span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">Should be 2</span></li></ol></div> |
| 674 |
!! end |
| 675 |
|
| 676 |
!! test |
| 677 |
Forward-referenced ref with follow |
| 678 |
!! wikitext |
| 679 |
<ref name="theName" /> |
| 680 |
<ref follow="theName">theFollows</ref> |
| 681 |
<references> |
| 682 |
<ref name="theName">theValue</ref> |
| 683 |
</references> |
| 684 |
!! html/php |
| 685 |
<p><sup id="cite_ref-theName_1-0" class="reference"><a href="#cite_note-theName-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 686 |
</p> |
| 687 |
<div class="mw-references-wrap"><ol class="references"> |
| 688 |
<li id="cite_note-theName-1"><span class="mw-cite-backlink"><a href="#cite_ref-theName_1-0">↑</a></span> <span class="reference-text"> theFollows <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name "theName" defined multiple times with different content</span></span> |
| 689 |
</li> |
| 690 |
</ol></div> |
| 691 |
!! html/parsoid |
| 692 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-theName_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"theName"}}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 693 |
<sup about="#mwt4" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"follow":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-1"}}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 694 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName-1" class="mw-reference-text reference-text"><span typeof="mw:Cite/Follow" about="#mwt4"> theFollows</span></span></li></ol></div> |
| 695 |
!! end |
| 696 |
|
| 697 |
!! test |
| 698 |
Follow following a named ref with multiple definitions |
| 699 |
!! wikitext |
| 700 |
<ref name="test">123</ref> |
| 701 |
<ref name="test">234</ref> |
| 702 |
<ref follow="test">345</ref> |
| 703 |
<references /> |
| 704 |
!! html/parsoid |
| 705 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-test_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"test"},"body":{"id":"mw-reference-text-cite_note-test-1"}}'><a href="./Parser_test#cite_note-test-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 706 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-test_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"test"},"body":{"html":"234"},"errors":[{"key":"cite_error_references_duplicate_key","params":["test"]}]}'><a href="./Parser_test#cite_note-test-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 707 |
<sup about="#mwt6" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"follow":"test"},"body":{"id":"mw-reference-text-cite_note-test-1"}}'><a href="./Parser_test#cite_note-test-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 708 |
<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-test-1" id="cite_note-test-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-test_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-test_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-test-1" class="mw-reference-text reference-text">123<span typeof="mw:Cite/Follow" about="#mwt6"> 345</span></span></li></ol></div> |
| 709 |
!! end |
| 710 |
|
| 711 |
!! test |
| 712 |
Multiple follow after refs without content and trailing ref with content in references section |
| 713 |
!! wikitext |
| 714 |
ADD<ref name="theName" /> |
| 715 |
SUB<ref name="theName"></ref> |
| 716 |
MUL<ref follow="theName">theFollowValue</ref> |
| 717 |
MOD<ref follow="theName">anotherFollowValue</ref> |
| 718 |
<references> |
| 719 |
<ref name="theName"> theValue</ref> |
| 720 |
</references> |
| 721 |
!! html/php |
| 722 |
<p>ADD<sup id="cite_ref-theName_1-0" class="reference"><a href="#cite_note-theName-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 723 |
SUB<sup id="cite_ref-theName_1-1" class="reference"><a href="#cite_note-theName-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 724 |
MUL |
| 725 |
MOD |
| 726 |
</p> |
| 727 |
<div class="mw-references-wrap"><ol class="references"> |
| 728 |
<li id="cite_note-theName-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-theName_1-0">1.0</a></sup> <sup><a href="#cite_ref-theName_1-1">1.1</a></sup></span> <span class="reference-text"> theFollowValue anotherFollowValue <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name "theName" defined multiple times with different content</span></span> |
| 729 |
</li> |
| 730 |
</ol></div> |
| 731 |
!! html/parsoid |
| 732 |
<p>ADD<sup about="#mwt2" class="mw-ref reference" id="cite_ref-theName_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"theName"}}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 733 |
SUB<sup about="#mwt4" class="mw-ref reference" id="cite_ref-theName_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"theName"},"body":{"html":""}}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 734 |
MUL<sup about="#mwt6" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"follow":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-1"}}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 735 |
MOD<sup about="#mwt8" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"follow":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-1"}}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 736 |
<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" class="mw-cite-backlink"><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 reference-text"><span typeof="mw:Cite/Follow" about="#mwt6"> theFollowValue</span><span typeof="mw:Cite/Follow" about="#mwt8"> anotherFollowValue</span></span></li></ol></div> |
| 737 |
!!end |
| 738 |
|
| 739 |
# T307741: Parsoid fails this test in both standalone and integrated modes. |
| 740 |
!! test |
| 741 |
Report bad attributes in ref tags |
| 742 |
!! wikitext |
| 743 |
<ref name="theName" group="theGroup" dummy="dummy">theValue</ref> |
| 744 |
<references group="theGroup" /> |
| 745 |
!! html |
| 746 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code><ref></code> tag</span> |
| 747 |
</p> |
| 748 |
!! end |
| 749 |
|
| 750 |
!! test |
| 751 |
Simple <ref>, with <references/> in group |
| 752 |
!! wikitext |
| 753 |
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref> |
| 754 |
Wikipedia rocks!<ref group="note">Proceeds of Rockology, vol. XXI</ref> |
| 755 |
|
| 756 |
<references /> |
| 757 |
<references group="note" /> |
| 758 |
!! html |
| 759 |
<p>Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 760 |
Wikipedia rocks!<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>note 1<span class="cite-bracket">]</span></a></sup> |
| 761 |
</p> |
| 762 |
<div class="mw-references-wrap"><ol class="references"> |
| 763 |
<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> |
| 764 |
</li> |
| 765 |
</ol></div> |
| 766 |
<div class="mw-references-wrap"><ol class="references"> |
| 767 |
<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> |
| 768 |
</li> |
| 769 |
</ol></div> |
| 770 |
!! html/parsoid |
| 771 |
<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> |
| 772 |
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> |
| 773 |
|
| 774 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">Proceeds of Rockology, vol. XXI</span></li></ol></div> |
| 775 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" data-mw-group="note" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">Proceeds of Rockology, vol. XXI</span></li></ol></div> |
| 776 |
!! end |
| 777 |
|
| 778 |
!! test |
| 779 |
Simple <ref>, with <references/> in group, with groupname in Chinese |
| 780 |
!! wikitext |
| 781 |
AAA<ref group="参">ref a</ref>BBB<ref group="注">note b</ref>CCC<ref group="参">ref c</ref> |
| 782 |
|
| 783 |
;refs |
| 784 |
<references group="参" /> |
| 785 |
|
| 786 |
;notes |
| 787 |
<references group="注" /> |
| 788 |
!! html |
| 789 |
<p>AAA<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>参 1<span class="cite-bracket">]</span></a></sup>BBB<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>注 1<span class="cite-bracket">]</span></a></sup>CCC<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>参 2<span class="cite-bracket">]</span></a></sup> |
| 790 |
</p> |
| 791 |
<dl><dt>refs</dt></dl> |
| 792 |
<div class="mw-references-wrap"><ol class="references"> |
| 793 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">ref a</span> |
| 794 |
</li> |
| 795 |
<li id="cite_note-3"><span class="mw-cite-backlink"><a href="#cite_ref-3">↑</a></span> <span class="reference-text">ref c</span> |
| 796 |
</li> |
| 797 |
</ol></div> |
| 798 |
<dl><dt>notes</dt></dl> |
| 799 |
<div class="mw-references-wrap"><ol class="references"> |
| 800 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">note b</span> |
| 801 |
</li> |
| 802 |
</ol></div> |
| 803 |
!! html/parsoid |
| 804 |
<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> |
| 805 |
|
| 806 |
<dl><dt>refs</dt></dl> |
| 807 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" data-mw-group="参" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">ref a</span></li><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" data-mw-group="参" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text">ref c</span></li></ol></div> |
| 808 |
|
| 809 |
<dl><dt>notes</dt></dl> |
| 810 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" data-mw-group="注" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">note b</span></li></ol></div> |
| 811 |
!! end |
| 812 |
|
| 813 |
## No point running non-wt2html modes with Parsoid since the " g " |
| 814 |
## will get normalized and html2wt, wt2wt, html2html modes will fail. |
| 815 |
!! test |
| 816 |
Attributes are trimmed by the parser, see Sanitizer::decodeTagAttributes() |
| 817 |
!! options |
| 818 |
parsoid=wt2html |
| 819 |
!! wikitext |
| 820 |
<ref group="g" name="n1">in group g</ref> |
| 821 |
<ref group=" g " name=" n2 ">in group " g "</ref> |
| 822 |
<references group="g" /> |
| 823 |
<references group=" g " /> |
| 824 |
!! html |
| 825 |
<p><sup id="cite_ref-n1_1-0" class="reference"><a href="#cite_note-n1-1"><span class="cite-bracket">[</span>g 1<span class="cite-bracket">]</span></a></sup> |
| 826 |
<sup id="cite_ref-n2_2-0" class="reference"><a href="#cite_note-n2-2"><span class="cite-bracket">[</span>g 2<span class="cite-bracket">]</span></a></sup> |
| 827 |
</p> |
| 828 |
<div class="mw-references-wrap"><ol class="references"> |
| 829 |
<li id="cite_note-n1-1"><span class="mw-cite-backlink"><a href="#cite_ref-n1_1-0">↑</a></span> <span class="reference-text">in group g</span> |
| 830 |
</li> |
| 831 |
<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> |
| 832 |
</li> |
| 833 |
</ol></div> |
| 834 |
!! html/parsoid |
| 835 |
<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> |
| 836 |
<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> |
| 837 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-n1_1-0" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-n1-1" class="mw-reference-text reference-text">in group g</span></li><li about="#cite_note-n2-2" id="cite_note-n2-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-n2_2-0" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-n2-2" class="mw-reference-text reference-text">in group " g "</span></li></ol></div> |
| 838 |
<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> |
| 839 |
!! end |
| 840 |
|
| 841 |
!! test |
| 842 |
<ref> defined in <references> |
| 843 |
!! wikitext |
| 844 |
<ref name="foo" /> |
| 845 |
|
| 846 |
<references> |
| 847 |
<ref name="foo">BAR</ref> |
| 848 |
</references> |
| 849 |
!! html |
| 850 |
<p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 851 |
</p> |
| 852 |
<div class="mw-references-wrap"><ol class="references"> |
| 853 |
<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> |
| 854 |
</li> |
| 855 |
</ol></div> |
| 856 |
!! html/parsoid |
| 857 |
<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> |
| 858 |
|
| 859 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text reference-text">BAR</span></li></ol></div> |
| 860 |
!! end |
| 861 |
|
| 862 |
!! test |
| 863 |
<ref> defined in <references> called with #tag |
| 864 |
!! wikitext |
| 865 |
<ref name="foo" /> |
| 866 |
|
| 867 |
{{#tag:references| |
| 868 |
<Ref name="foo">BAR</ref> |
| 869 |
}} |
| 870 |
!! html |
| 871 |
<p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 872 |
</p> |
| 873 |
<div class="mw-references-wrap"><ol class="references"> |
| 874 |
<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> |
| 875 |
</li> |
| 876 |
</ol></div> |
| 877 |
!! html/parsoid |
| 878 |
<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> |
| 879 |
|
| 880 |
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Transclusion" about="#mwt6" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"name":"references","attrs":{},"body":{"extsrc":"\n<Ref name=\"foo\">BAR</ref>\n"},"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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text reference-text">BAR</span></li></ol></div> |
| 881 |
!! end |
| 882 |
|
| 883 |
# T307741: Parsoid fails this test in both standalone and integrated modes. |
| 884 |
!! test |
| 885 |
T242437 - Nested references edge case, outer tag function with LDR |
| 886 |
!! wikitext |
| 887 |
<ref name="foo" /> |
| 888 |
{{#tag:references| |
| 889 |
<ref name="foo">bar</ref> |
| 890 |
|
| 891 |
<References /> |
| 892 |
}} |
| 893 |
!! html/php |
| 894 |
<p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 895 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Closing tag missing for <code><references></code></span> |
| 896 |
</p> |
| 897 |
!! html/parsoid |
| 898 |
Parsoid fails this right now |
| 899 |
!! end |
| 900 |
|
| 901 |
# T307741: Parsoid fails this test in both standalone and integrated modes. |
| 902 |
!! test |
| 903 |
T242437 - Nested references edge case, outer tag function, inner LDR |
| 904 |
!! wikitext |
| 905 |
<ref name="foo" /> |
| 906 |
{{#tag:references| |
| 907 |
<references> |
| 908 |
<ref name="foo">bar</ref> |
| 909 |
</references> |
| 910 |
}} |
| 911 |
!! html/php |
| 912 |
<p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 913 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Closing tag missing for <code><references></code></span> |
| 914 |
</p> |
| 915 |
!! html/parsoid |
| 916 |
Parsoid fails this right now |
| 917 |
!! end |
| 918 |
|
| 919 |
!! test |
| 920 |
T242437 - Nested references edge case, inner tag function with LDR |
| 921 |
!! wikitext |
| 922 |
<ref name="foo" /> |
| 923 |
|
| 924 |
<references> |
| 925 |
{{#tag:references| |
| 926 |
<ref name="foo">bar</ref> |
| 927 |
}} |
| 928 |
</references> |
| 929 |
!! html |
| 930 |
<p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 931 |
</p> |
| 932 |
<div class="mw-references-wrap"><ol class="references"> |
| 933 |
<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> |
| 934 |
</li> |
| 935 |
</ol></div> |
| 936 |
!! html/parsoid |
| 937 |
<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> |
| 938 |
|
| 939 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text reference-text">bar</span></li></ol></div> |
| 940 |
!! end |
| 941 |
|
| 942 |
!! test |
| 943 |
<ref> defined in <references> error conditions |
| 944 |
!! wikitext |
| 945 |
<ref name="foo" group="2" /> |
| 946 |
|
| 947 |
<references group="2"> |
| 948 |
<ref name="foo" /> |
| 949 |
<ref name="unused">BAR</ref> |
| 950 |
<ref name="foo" group="1">bad group</ref> |
| 951 |
<ref name="bar" group="1" /> |
| 952 |
<ref>BAR BAR</ref> |
| 953 |
</references> |
| 954 |
!! html/php |
| 955 |
<p><sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">[</span>2 1<span class="cite-bracket">]</span></a></sup> |
| 956 |
</p> |
| 957 |
<div class="mw-references-wrap"><ol class="references"> |
| 958 |
<li id="cite_note-foo-1"><span class="mw-cite-backlink"><a href="#cite_ref-foo_1-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>foo</code></span></li> |
| 959 |
</ol></div> |
| 960 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag with name "foo" defined in <code><references></code> group "2" has no content.</span><br /> |
| 961 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag with name "unused" defined in <code><references></code> is not used in prior text.</span><br /> |
| 962 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag in <code><references></code> has conflicting group attribute "1".</span><br /> |
| 963 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag defined in <code><references></code> has no name attribute.</span> |
| 964 |
</p> |
| 965 |
!! html/parsoid |
| 966 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-foo_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"foo","group":"2"},"errors":[{"key":"cite_error_references_no_text","params":["foo"]}]}'><a href="./Parser_test#cite_note-foo-1" style="counter-reset: mw-Ref 1;" data-mw-group="2"><span class="mw-reflink-text">[2 1]</span></a></sup></p> |
| 967 |
|
| 968 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{"group":"2"},"body":{"html":"\n<sup about=\"#mwt9\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"foo\",\"\"]},{\"key\":\"cite_error_references_no_text\",\"params\":[\"foo\"]}]}'><a href=\"./Parser_test#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"2\"><span class=\"mw-reflink-text\">[2 1]</span></a></sup>\n<sup about=\"#mwt10\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"unused\"},\"body\":{\"id\":\"mw-reference-text-cite_note-unused-2\"},\"errors\":[{\"key\":\"cite_error_references_missing_key\",\"params\":[\"unused\"]}]}'><a href=\"./Parser_test#cite_note-unused-2\" style=\"counter-reset: mw-Ref 2;\" data-mw-group=\"2\"><span class=\"mw-reflink-text\">[2 2]</span></a></sup>\n<sup about=\"#mwt11\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\",\"group\":\"1\"},\"body\":{\"id\":\"mw-reference-text-cite_note-foo-3\"},\"errors\":[{\"key\":\"cite_error_references_group_mismatch\",\"params\":[\"1\"]},{\"key\":\"cite_error_references_missing_key\",\"params\":[\"foo\"]},{\"key\":\"cite_error_group_refs_without_references\",\"params\":[\"1\"]}]}'><a href=\"./Parser_test#cite_note-foo-3\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"1\"><span class=\"mw-reflink-text\">[1 1]</span></a></sup>\n<sup about=\"#mwt12\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"bar\",\"group\":\"1\"},\"errors\":[{\"key\":\"cite_error_references_group_mismatch\",\"params\":[\"1\"]},{\"key\":\"cite_error_references_missing_key\",\"params\":[\"bar\"]},{\"key\":\"cite_error_empty_references_define\",\"params\":[\"bar\",\"1\"]},{\"key\":\"cite_error_group_refs_without_references\",\"params\":[\"1\"]},{\"key\":\"cite_error_references_no_text\",\"params\":[\"bar\"]}]}'><a href=\"./Parser_test#cite_note-bar-4\" style=\"counter-reset: mw-Ref 2;\" data-mw-group=\"1\"><span class=\"mw-reflink-text\">[1 2]</span></a></sup>\n<sup about=\"#mwt13\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{},\"body\":{\"id\":\"mw-reference-text-cite_note-5\"},\"errors\":[{\"key\":\"cite_error_references_no_key\"}]}'><a href=\"./Parser_test#cite_note-5\" style=\"counter-reset: mw-Ref 3;\" data-mw-group=\"2\"><span class=\"mw-reflink-text\">[2 3]</span></a></sup>\n"}}'><ol class="mw-references references" data-mw-group="2"><li about="#cite_note-foo-1" id="cite_note-foo-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_1-0" data-mw-group="2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text reference-text"></span></li><li about="#cite_note-unused-2" id="cite_note-unused-2"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-unused-2" class="mw-reference-text reference-text">BAR</span></li><li about="#cite_note-5" id="cite_note-5"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-5" class="mw-reference-text reference-text">BAR BAR</span></li></ol></div> |
| 969 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt15" data-mw='{"name":"references","attrs":{"group":"1"},"autoGenerated":true}'><ol class="mw-references references" data-mw-group="1"><li about="#cite_note-foo-3" id="cite_note-foo-3"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-foo-3" class="mw-reference-text reference-text">bad group</span></li><li about="#cite_note-bar-4" id="cite_note-bar-4"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-bar-4" class="mw-reference-text reference-text"></span></li></ol></div> |
| 970 |
!! end |
| 971 |
|
| 972 |
!! test |
| 973 |
<ref> ungrouped and grouped refs with and without content defined |
| 974 |
!! wikitext |
| 975 |
ONE<ref name="foo" /> |
| 976 |
<references /> |
| 977 |
TWO<ref group="NOTES" name="foo" /> |
| 978 |
THREE<ref group="NOTES" name="bar">CONTENT</ref> |
| 979 |
<references group="NOTES" /> |
| 980 |
!! html/parsoid |
| 981 |
<p>ONE<sup about="#mwt3" class="mw-ref reference" id="cite_ref-foo_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"foo"},"errors":[{"key":"cite_error_references_no_text","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></p> |
| 982 |
<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-foo-1" id="cite_note-foo-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text reference-text"></span></li></ol></div> |
| 983 |
<p>TWO<sup about="#mwt9" class="mw-ref reference" id="cite_ref-foo_2-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"foo"},"errors":[{"key":"cite_error_references_no_text","params":["foo"]}]}'><a href="./Parser_test#cite_note-foo-2" style="counter-reset: mw-Ref 1;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 1]</span></a></sup> |
| 984 |
THREE<sup about="#mwt12" class="mw-ref reference" id="cite_ref-bar_3-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"bar"},"body":{"id":"mw-reference-text-cite_note-bar-3"}}'><a href="./Parser_test#cite_note-bar-3" style="counter-reset: mw-Ref 2;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 2]</span></a></sup></p> |
| 985 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt15" data-parsoid='{"group":"NOTES"}' data-mw='{"name":"references","attrs":{"group":"NOTES"}}'><ol class="mw-references references" data-mw-group="NOTES"><li about="#cite_note-foo-2" id="cite_note-foo-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_2-0" data-mw-group="NOTES" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-2" class="mw-reference-text reference-text"></span></li><li about="#cite_note-bar-3" id="cite_note-bar-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-bar_3-0" data-mw-group="NOTES" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-bar-3" class="mw-reference-text reference-text">CONTENT</span></li></ol></div> |
| 986 |
!! html/php |
| 987 |
<p>ONE<sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 988 |
</p> |
| 989 |
<div class="mw-references-wrap"><ol class="references"> |
| 990 |
<li id="cite_note-foo-1"><span class="mw-cite-backlink"><a href="#cite_ref-foo_1-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>foo</code></span></li> |
| 991 |
</ol></div> |
| 992 |
<p>TWO<sup id="cite_ref-foo_2-0" class="reference"><a href="#cite_note-foo-2"><span class="cite-bracket">[</span>NOTES 1<span class="cite-bracket">]</span></a></sup> |
| 993 |
THREE<sup id="cite_ref-bar_3-0" class="reference"><a href="#cite_note-bar-3"><span class="cite-bracket">[</span>NOTES 2<span class="cite-bracket">]</span></a></sup> |
| 994 |
</p> |
| 995 |
<div class="mw-references-wrap"><ol class="references"> |
| 996 |
<li id="cite_note-foo-2"><span class="mw-cite-backlink"><a href="#cite_ref-foo_2-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>foo</code></span></li> |
| 997 |
<li id="cite_note-bar-3"><span class="mw-cite-backlink"><a href="#cite_ref-bar_3-0">↑</a></span> <span class="reference-text">CONTENT</span> |
| 998 |
</li> |
| 999 |
</ol></div> |
| 1000 |
!! end |
| 1001 |
|
| 1002 |
!! test |
| 1003 |
Error conditions on non-visible content |
| 1004 |
!! wikitext |
| 1005 |
<ref name="a">x</ref> |
| 1006 |
<ref name="b"> </ref> |
| 1007 |
<ref name="c" /> |
| 1008 |
<references> |
| 1009 |
<ref name="a" /> |
| 1010 |
<ref name="b" /> |
| 1011 |
<ref name="c"> </ref> |
| 1012 |
</references> |
| 1013 |
!! html/php |
| 1014 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1015 |
<sup id="cite_ref-b_2-0" class="reference"><a href="#cite_note-b-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 1016 |
<sup id="cite_ref-c_3-0" class="reference"><a href="#cite_note-c-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> |
| 1017 |
</p> |
| 1018 |
<div class="mw-references-wrap"><ol class="references"> |
| 1019 |
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">x</span> |
| 1020 |
</li> |
| 1021 |
<li id="cite_note-b-2"><span class="mw-cite-backlink"><a href="#cite_ref-b_2-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>b</code></span></li> |
| 1022 |
<li id="cite_note-c-3"><span class="mw-cite-backlink"><a href="#cite_ref-c_3-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>c</code></span></li> |
| 1023 |
</ol></div> |
| 1024 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag with name "a" defined in <code><references></code> group "" has no content.</span><br /> |
| 1025 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag with name "b" defined in <code><references></code> group "" has no content.</span><br /> |
| 1026 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag with name "c" defined in <code><references></code> group "" has no content.</span> |
| 1027 |
</p> |
| 1028 |
!! html/parsoid |
| 1029 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/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> |
| 1030 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-b_2-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"b"},"body":{"html":" "},"errors":[{"key":"cite_error_references_no_text","params":["b"]}]}'><a href="./Parser_test#cite_note-b-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 1031 |
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-c_3-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"c"},"errors":[{"key":"cite_error_references_no_text","params":["c"]}]}'><a href="./Parser_test#cite_note-c-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 1032 |
<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\",\"params\":[\"b\"]}]}'><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\",\"params\":[\"c\"]}]}'><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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">x</span></li><li about="#cite_note-b-2" id="cite_note-b-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-b_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-b-2" class="mw-reference-text reference-text"></span></li><li about="#cite_note-c-3" id="cite_note-c-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-c_3-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-c-3" class="mw-reference-text reference-text"></span></li></ol></div> |
| 1033 |
!! end |
| 1034 |
|
| 1035 |
# This article is used in the '<ref> with custom group link' test below |
| 1036 |
!! article |
| 1037 |
MediaWiki:cite_link_label_group-klingon |
| 1038 |
!! text |
| 1039 |
wa' cha' wej loS vagh jav Soch chorgh Hut wa'maH |
| 1040 |
!! endarticle |
| 1041 |
|
| 1042 |
## Parsoid doesn't use messages for i18n. It relies on Cite-specific CSS rules |
| 1043 |
## to localize. This CSS is expected to be added to a wiki's |
| 1044 |
## MediaWiki:Common.css page. |
| 1045 |
## As such, Parsoid's output will differ for klingon i18n label tests. |
| 1046 |
## T308094: document this transition. |
| 1047 |
!! test |
| 1048 |
<ref> with custom group link with number names in Klingon |
| 1049 |
!! wikitext |
| 1050 |
Wikipedia rocks!<ref group="klingon">Proceeds of Rockology, vol. XXI</ref> |
| 1051 |
|
| 1052 |
<references group="klingon" /> |
| 1053 |
!! html |
| 1054 |
<p>Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>wa'<span class="cite-bracket">]</span></a></sup> |
| 1055 |
</p> |
| 1056 |
<div class="mw-references-wrap"><ol class="references"> |
| 1057 |
<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> |
| 1058 |
</li> |
| 1059 |
</ol></div> |
| 1060 |
!! html/parsoid |
| 1061 |
<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> |
| 1062 |
|
| 1063 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" data-mw-group="klingon" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">Proceeds of Rockology, vol. XXI</span></li></ol></div> |
| 1064 |
!! end |
| 1065 |
|
| 1066 |
# See above: Parsoid uses a different mechanism for custom link labels |
| 1067 |
!! test |
| 1068 |
Consecutive whitespace in custom link label message should not create empty [] |
| 1069 |
!! wikitext |
| 1070 |
<ref group="klingon">1st</ref> |
| 1071 |
<ref group="klingon">2nd</ref> |
| 1072 |
<references group="klingon" /> |
| 1073 |
!! html |
| 1074 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>wa'<span class="cite-bracket">]</span></a></sup> |
| 1075 |
<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>cha'<span class="cite-bracket">]</span></a></sup> |
| 1076 |
</p> |
| 1077 |
<div class="mw-references-wrap"><ol class="references"> |
| 1078 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">1st</span> |
| 1079 |
</li> |
| 1080 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">2nd</span> |
| 1081 |
</li> |
| 1082 |
</ol></div> |
| 1083 |
!! html/parsoid |
| 1084 |
<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> |
| 1085 |
<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> |
| 1086 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" data-mw-group="klingon" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1st</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" data-mw-group="klingon" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2nd</span></li></ol></div> |
| 1087 |
!! end |
| 1088 |
|
| 1089 |
!! test |
| 1090 |
Bug 31374 regression check: nested strip items |
| 1091 |
!! wikitext |
| 1092 |
{{#tag:ref|note<ref>reference</ref>|group=Note}} |
| 1093 |
<references group="Note" /> |
| 1094 |
<references /> |
| 1095 |
!! html |
| 1096 |
<p><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>Note 1<span class="cite-bracket">]</span></a></sup> |
| 1097 |
</p> |
| 1098 |
<div class="mw-references-wrap"><ol class="references"> |
| 1099 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">note<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></span> |
| 1100 |
</li> |
| 1101 |
</ol></div> |
| 1102 |
<div class="mw-references-wrap"><ol class="references"> |
| 1103 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">reference</span> |
| 1104 |
</li> |
| 1105 |
</ol></div> |
| 1106 |
!! html/parsoid |
| 1107 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"Note"},"body":{"extsrc":"note<ref>reference</ref>"},"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> |
| 1108 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" data-mw-group="Note" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text 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> |
| 1109 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">reference</span></li></ol></div> |
| 1110 |
!! end |
| 1111 |
|
| 1112 |
!! test |
| 1113 |
Bug 13073 regression check: wrapped <references> |
| 1114 |
!! options |
| 1115 |
parsoid={"suppressErrors": true} |
| 1116 |
!! wikitext |
| 1117 |
<ref> |
| 1118 |
foo |
| 1119 |
</ref> |
| 1120 |
<div><references /></div> |
| 1121 |
!! html/php |
| 1122 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1123 |
</p> |
| 1124 |
<div><div class="mw-references-wrap"><ol class="references"> |
| 1125 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text"> |
| 1126 |
foo</span> |
| 1127 |
</li> |
| 1128 |
</ol></div></div> |
| 1129 |
!! html/parsoid |
| 1130 |
<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> |
| 1131 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"> |
| 1132 |
foo |
| 1133 |
</span></li></ol></div></div> |
| 1134 |
!! end |
| 1135 |
|
| 1136 |
!! test |
| 1137 |
<ref> with no name and no content. |
| 1138 |
!! wikitext |
| 1139 |
Bla.<ref></ref> |
| 1140 |
foo.<ref /> |
| 1141 |
zero{{1x|<ref />}} |
| 1142 |
<references /> |
| 1143 |
!! html/php |
| 1144 |
<p>Bla.<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; refs with no name must have content</span> |
| 1145 |
foo.<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: The opening <code><ref></code> tag is malformed or has a bad name</span> |
| 1146 |
zero<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: The opening <code><ref></code> tag is malformed or has a bad name</span> |
| 1147 |
</p> |
| 1148 |
!! html/parsoid |
| 1149 |
<p>Bla.<sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{},"body":{"html":""},"errors":[{"key":"cite_error_ref_no_input"}]}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1150 |
foo.<sup about="#mwt6" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{},"errors":[{"key":"cite_error_ref_no_key"}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 1151 |
zero<sup about="#mwt8" class="mw-ref reference" id="cite_ref-3" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{},"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"<ref />"}},"i":0}}],"errors":[{"key":"cite_error_ref_no_key"}]}'><a href="./Parser_test#cite_note-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 1152 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt13" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"></span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text"></span></li><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text"></span></li></ol></div> |
| 1153 |
!! end |
| 1154 |
|
| 1155 |
!! test |
| 1156 |
<ref> with an empty-string name parameter and no content. |
| 1157 |
!! wikitext |
| 1158 |
Bla.<ref name=""> </ref> |
| 1159 |
<references /> |
| 1160 |
!! html/php |
| 1161 |
<p>Bla.<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; refs with no name must have content</span> |
| 1162 |
</p> |
| 1163 |
!! html/parsoid |
| 1164 |
<p>Bla.<sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":""},"body":{"html":" "},"errors":[{"key":"cite_error_ref_no_input"}]}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1165 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"></span></li></ol></div> |
| 1166 |
!! end |
| 1167 |
|
| 1168 |
!! test |
| 1169 |
<ref> with whitespace only name parameter and no content. |
| 1170 |
!! options |
| 1171 |
parsoid=wt2html |
| 1172 |
!! wikitext |
| 1173 |
Hi <ref name=" "> </ref> |
| 1174 |
Ho <ref name=" " /> |
| 1175 |
!! html/php |
| 1176 |
<p>Hi <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; refs with no name must have content</span> |
| 1177 |
Ho <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: The opening <code><ref></code> tag is malformed or has a bad name</span> |
| 1178 |
</p> |
| 1179 |
!! html/parsoid |
| 1180 |
<p>Hi <sup about="#mwt3" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":""},"body":{"html":" "},"errors":[{"key":"cite_error_ref_no_input"}]}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1181 |
Ho <sup about="#mwt6" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":""},"errors":[{"key":"cite_error_ref_no_key"}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 1182 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt7" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"></span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text"></span></li></ol></div> |
| 1183 |
!! end |
| 1184 |
|
| 1185 |
!! test |
| 1186 |
<ref> with a non-empty name parameter and no content. |
| 1187 |
!! wikitext |
| 1188 |
Bla.<ref name="void"> </ref> |
| 1189 |
<references /> |
| 1190 |
!! html/php |
| 1191 |
<p>Bla.<sup id="cite_ref-void_1-0" class="reference"><a href="#cite_note-void-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1192 |
</p> |
| 1193 |
<div class="mw-references-wrap"><ol class="references"> |
| 1194 |
<li id="cite_note-void-1"><span class="mw-cite-backlink"><a href="#cite_ref-void_1-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>void</code></span></li> |
| 1195 |
</ol></div> |
| 1196 |
!! html/parsoid |
| 1197 |
<p>Bla.<sup about="#mwt3" class="mw-ref reference" id="cite_ref-void_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"void"},"body":{"html":" "},"errors":[{"key":"cite_error_references_no_text","params":["void"]}]}'><a href="./Parser_test#cite_note-void-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1198 |
<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-void-1" id="cite_note-void-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-void_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-void-1" class="mw-reference-text reference-text"></span></li></ol></div> |
| 1199 |
!! end |
| 1200 |
|
| 1201 |
!! test |
| 1202 |
Whitespace only doesn't set content for named ref |
| 1203 |
!! wikitext |
| 1204 |
Hi <ref name="ho"> </ref> |
| 1205 |
Hi <ref name="ho">Off to work we go!</ref> |
| 1206 |
<references /> |
| 1207 |
!! html/php |
| 1208 |
<p>Hi <sup id="cite_ref-ho_1-0" class="reference"><a href="#cite_note-ho-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1209 |
Hi <sup id="cite_ref-ho_1-1" class="reference"><a href="#cite_note-ho-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1210 |
</p> |
| 1211 |
<div class="mw-references-wrap"><ol class="references"> |
| 1212 |
<li id="cite_note-ho-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-ho_1-0">1.0</a></sup> <sup><a href="#cite_ref-ho_1-1">1.1</a></sup></span> <span class="reference-text">Off to work we go!</span> |
| 1213 |
</li> |
| 1214 |
</ol></div> |
| 1215 |
!! html/parsoid |
| 1216 |
<p>Hi <sup about="#mwt3" class="mw-ref reference" id="cite_ref-ho_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"ho"},"body":{"html":" "}}'><a href="./Parser_test#cite_note-ho-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1217 |
Hi <sup about="#mwt6" class="mw-ref reference" id="cite_ref-ho_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"ho"},"body":{"id":"mw-reference-text-cite_note-ho-1"}}'><a href="./Parser_test#cite_note-ho-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1218 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-ho-1" id="cite_note-ho-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-ho_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-ho_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-ho-1" class="mw-reference-text reference-text">Off to work we go!</span></li></ol></div> |
| 1219 |
!! end |
| 1220 |
|
| 1221 |
!! test |
| 1222 |
Multiple definition (outside <references/>) |
| 1223 |
!! wikitext |
| 1224 |
<ref name="a">abc</ref> |
| 1225 |
<ref name="a">def</ref> |
| 1226 |
<references /> |
| 1227 |
!! html/php |
| 1228 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1229 |
<sup id="cite_ref-a_1-1" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1230 |
</p> |
| 1231 |
<div class="mw-references-wrap"><ol class="references"> |
| 1232 |
<li id="cite_note-a-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-a_1-0">1.0</a></sup> <sup><a href="#cite_ref-a_1-1">1.1</a></sup></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> |
| 1233 |
</li> |
| 1234 |
</ol></div> |
| 1235 |
!! html/parsoid |
| 1236 |
<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"},"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> |
| 1237 |
<sup about="#mwt6" class="mw-ref reference" id="cite_ref-a_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" 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></p> |
| 1238 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" 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" class="mw-cite-backlink"><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></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">abc</span></li></ol></div> |
| 1239 |
!! end |
| 1240 |
|
| 1241 |
!! test |
| 1242 |
Multiple definition (inside <references/>) |
| 1243 |
!! wikitext |
| 1244 |
<ref name="a" /> |
| 1245 |
<references> |
| 1246 |
<ref name="a">abc</ref> |
| 1247 |
<ref name="a">def</ref> |
| 1248 |
</references> |
| 1249 |
!! html/php |
| 1250 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1251 |
</p> |
| 1252 |
<div class="mw-references-wrap"><ol class="references"> |
| 1253 |
<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> |
| 1254 |
</li> |
| 1255 |
</ol></div> |
| 1256 |
!! html/parsoid |
| 1257 |
<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></p> |
| 1258 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" 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\":[30,53,14,6]}' 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;\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[1]</span></a></sup>\n<sup about=\"#mwt10\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid='{\"dsr\":[54,77,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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">abc</span></li></ol></div> |
| 1259 |
!! end |
| 1260 |
|
| 1261 |
!! test |
| 1262 |
Multiple definition (mixed outside/inside) |
| 1263 |
!! wikitext |
| 1264 |
<ref name="a">abc</ref> |
| 1265 |
<references> |
| 1266 |
<ref name="a">def</ref> |
| 1267 |
</references> |
| 1268 |
!! html/php |
| 1269 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1270 |
</p> |
| 1271 |
<div class="mw-references-wrap"><ol class="references"> |
| 1272 |
<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> |
| 1273 |
</li> |
| 1274 |
</ol></div> |
| 1275 |
!! html/parsoid |
| 1276 |
<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"},"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></p> |
| 1277 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">abc</span></li></ol></div> |
| 1278 |
!! end |
| 1279 |
|
| 1280 |
!! test |
| 1281 |
T202593: Conflicting dir attributes |
| 1282 |
!! wikitext |
| 1283 |
<ref name="a" dir="ltr" /> |
| 1284 |
<ref name="a" dir="rtl">abc</ref> |
| 1285 |
<references /> |
| 1286 |
!! html/php |
| 1287 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1288 |
<sup id="cite_ref-a_1-1" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1289 |
</p> |
| 1290 |
<div class="mw-references-wrap"><ol class="references"> |
| 1291 |
<li id="cite_note-a-1" class="mw-cite-dir-rtl"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-a_1-0">1.0</a></sup> <sup><a href="#cite_ref-a_1-1">1.1</a></sup></span> <span class="reference-text">abc <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: One of the <code><ref></code> tags with the name "a" does have a conflicting dir attribute.</span></span> |
| 1292 |
</li> |
| 1293 |
</ol></div> |
| 1294 |
!! html/parsoid |
| 1295 |
<p><sup class="mw-ref reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a","dir":"ltr"}}'><a href="./Parser_test#cite_note-a-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1296 |
<sup class="mw-ref reference" id="cite_ref-a_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"a","dir":"rtl"},"body":{"id":"mw-reference-text-cite_note-a-1"},"errors":[{"key":"cite_error_ref_conflicting_dir","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></p> |
| 1297 |
<div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'> |
| 1298 |
<ol class="mw-references references"> |
| 1299 |
<li id="cite_note-a-1" class="mw-cite-dir-rtl"><span rel="mw:referencedBy" class="mw-cite-backlink"><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></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">abc</span></li> |
| 1300 |
</ol> |
| 1301 |
</div> |
| 1302 |
!! end |
| 1303 |
|
| 1304 |
!! test |
| 1305 |
T202593: Conflicting dir attributes with the full ref first |
| 1306 |
!! wikitext |
| 1307 |
<ref name="a" dir="ltr">abc</ref> |
| 1308 |
<ref name="a" dir="rtl" /> |
| 1309 |
<references /> |
| 1310 |
!! html/php |
| 1311 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1312 |
<sup id="cite_ref-a_1-1" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1313 |
</p> |
| 1314 |
<div class="mw-references-wrap"><ol class="references"> |
| 1315 |
<li id="cite_note-a-1" class="mw-cite-dir-ltr"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-a_1-0">1.0</a></sup> <sup><a href="#cite_ref-a_1-1">1.1</a></sup></span> <span class="reference-text">abc <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: One of the <code><ref></code> tags with the name "a" does have a conflicting dir attribute.</span></span> |
| 1316 |
</li> |
| 1317 |
</ol></div> |
| 1318 |
!! html/parsoid |
| 1319 |
<p><sup class="mw-ref reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a","dir":"ltr"},"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> |
| 1320 |
<sup class="mw-ref reference" id="cite_ref-a_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"a","dir":"rtl"},"errors":[{"key":"cite_error_ref_conflicting_dir","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></p> |
| 1321 |
<div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'> |
| 1322 |
<ol class="mw-references references"> |
| 1323 |
<li id="cite_note-a-1" class="mw-cite-dir-ltr"><span rel="mw:referencedBy" class="mw-cite-backlink"><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></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">abc</span></li> |
| 1324 |
</ol> |
| 1325 |
</div> |
| 1326 |
!! end |
| 1327 |
|
| 1328 |
!! test |
| 1329 |
T202593: Identical dir attributes are pointless, but should not generate an error |
| 1330 |
!! wikitext |
| 1331 |
<ref name="a" dir="RTL" /> |
| 1332 |
<ref name="a" dir="rtl">abc</ref> |
| 1333 |
<references /> |
| 1334 |
!! html/php |
| 1335 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1336 |
<sup id="cite_ref-a_1-1" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1337 |
</p> |
| 1338 |
<div class="mw-references-wrap"><ol class="references"> |
| 1339 |
<li id="cite_note-a-1" class="mw-cite-dir-rtl"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-a_1-0">1.0</a></sup> <sup><a href="#cite_ref-a_1-1">1.1</a></sup></span> <span class="reference-text">abc</span> |
| 1340 |
</li> |
| 1341 |
</ol></div> |
| 1342 |
!! html/parsoid |
| 1343 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a","dir":"RTL"}}'><a href="./Parser_test#cite_note-a-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1344 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-a_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a","dir":"rtl"},"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></p> |
| 1345 |
<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-a-1" id="cite_note-a-1" class="mw-cite-dir-rtl"><span rel="mw:referencedBy" class="mw-cite-backlink"><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></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">abc</span></li></ol></div> |
| 1346 |
!! end |
| 1347 |
|
| 1348 |
# T307741: Parsoid fails this test in both standalone and integrated modes. |
| 1349 |
!! test |
| 1350 |
Multiple definition (inside {{#tag:references}}) |
| 1351 |
!! wikitext |
| 1352 |
<ref name="a" /> |
| 1353 |
{{#tag:references| |
| 1354 |
<ref name="a">abc</ref> |
| 1355 |
<ref name="a">def</ref> |
| 1356 |
}} |
| 1357 |
<references /> |
| 1358 |
!! html/php |
| 1359 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1360 |
</p> |
| 1361 |
<div class="mw-references-wrap"><ol class="references"> |
| 1362 |
<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> |
| 1363 |
</li> |
| 1364 |
</ol></div> |
| 1365 |
!! html/parsoid |
| 1366 |
Parsoid fails this right now |
| 1367 |
!! end |
| 1368 |
|
| 1369 |
# Parsoid doesn't rt cleanly because name attribute is actually broken |
| 1370 |
# here (<ref> tag closes at first >); see next test for a tidied version. |
| 1371 |
!! test |
| 1372 |
T29694 - [] in reference names in HTML5 fragment mode |
| 1373 |
!! config |
| 1374 |
wgFragmentMode=[ "html5" ] |
| 1375 |
!! options |
| 1376 |
parsoid=wt2html |
| 1377 |
!! wikitext |
| 1378 |
<ref name="[#foo] {bar} <baz>">[bar]</ref> |
| 1379 |
!! html/php |
| 1380 |
<p><sup id="cite_ref-[#foo]_{bar}_<baz_1-0" class="reference"><a href="#cite_note-[#foo]_{bar}_<baz-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1381 |
</p> |
| 1382 |
<div class="mw-references-wrap"><ol class="references"> |
| 1383 |
<li id="cite_note-[#foo]_{bar}_<baz-1"><span class="mw-cite-backlink"><a href="#cite_ref-[#foo]_{bar}_<baz_1-0">↑</a></span> <span class="reference-text">">[bar]</span> |
| 1384 |
</li> |
| 1385 |
</ol></div> |
| 1386 |
!! html/parsoid |
| 1387 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-[#foo]_{bar}_<baz_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"[#foo] {bar} <baz"},"body":{"id":"mw-reference-text-cite_note-[#foo]_{bar}_<baz-1"}}'><a href="./Parser_test#cite_note-[#foo]_{bar}_<baz-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1388 |
<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-[#foo]_{bar}_<baz-1" id="cite_note-[#foo]_{bar}_<baz-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-[#foo]_{bar}_<baz_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-[#foo]_{bar}_<baz-1" class="mw-reference-text reference-text">">[bar]</span></li></ol></div> |
| 1389 |
!! end |
| 1390 |
|
| 1391 |
!! test |
| 1392 |
T29694 - [] in reference names in HTML5 fragment mode (tidied) |
| 1393 |
!! config |
| 1394 |
wgFragmentMode=[ "html5" ] |
| 1395 |
!! wikitext |
| 1396 |
<ref name="[#foo] {bar} <baz>">[bar]</ref> |
| 1397 |
<references /> |
| 1398 |
!! html/php |
| 1399 |
<p><sup id="cite_ref-[#foo]_{bar}_<baz>_1-0" class="reference"><a href="#cite_note-[#foo]_{bar}_<baz>-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1400 |
</p> |
| 1401 |
<div class="mw-references-wrap"><ol class="references"> |
| 1402 |
<li id="cite_note-[#foo]_{bar}_<baz>-1"><span class="mw-cite-backlink"><a href="#cite_ref-[#foo]_{bar}_<baz>_1-0">↑</a></span> <span class="reference-text">[bar]</span> |
| 1403 |
</li> |
| 1404 |
</ol></div> |
| 1405 |
!! html/parsoid |
| 1406 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-[#foo]_{bar}_<baz>_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"[#foo] {bar} <baz>"},"body":{"id":"mw-reference-text-cite_note-[#foo]_{bar}_<baz>-1"}}'><a href="./Parser_test#cite_note-[#foo]_{bar}_<baz>-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1407 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-[#foo]_{bar}_<baz>-1" id="cite_note-[#foo]_{bar}_<baz>-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-[#foo]_{bar}_<baz>_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-[#foo]_{bar}_<baz>-1" class="mw-reference-text reference-text">[bar]</span></li></ol></div> |
| 1408 |
!! end |
| 1409 |
|
| 1410 |
|
| 1411 |
#### ---------------------------------------------------------------- |
| 1412 |
#### Parsoid-only testing of Parsoid's impl of <ref> and <references> |
| 1413 |
#### tags. Parsoid's output for these tags differs from that of the |
| 1414 |
#### PHP parser. |
| 1415 |
#### ---------------------------------------------------------------- |
| 1416 |
|
| 1417 |
!! test |
| 1418 |
Ref: 1. ref-location should be replaced with an index span |
| 1419 |
!! wikitext |
| 1420 |
A <ref>foo</ref> |
| 1421 |
B <ref name="x">foo</ref> |
| 1422 |
C <ref name="y" /> |
| 1423 |
<references /> |
| 1424 |
!! html/parsoid |
| 1425 |
<p>A <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> |
| 1426 |
B <sup about="#mwt6" class="mw-ref reference" id="cite_ref-x_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"},"body":{"id":"mw-reference-text-cite_note-x-2"}}'><a href="./Parser_test#cite_note-x-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 1427 |
C <sup about="#mwt9" class="mw-ref reference" id="cite_ref-y_3-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"y"},"errors":[{"key":"cite_error_references_no_text","params":["y"]}]}'><a href="./Parser_test#cite_note-y-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 1428 |
<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-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li><li about="#cite_note-x-2" id="cite_note-x-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-x_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-x-2" class="mw-reference-text reference-text">foo</span></li><li about="#cite_note-y-3" id="cite_note-y-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-y_3-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-y-3" class="mw-reference-text reference-text"></span></li></ol></div> |
| 1429 |
!! end |
| 1430 |
|
| 1431 |
!! test |
| 1432 |
Ref: 2. ref-tags with identical names should all get the same index |
| 1433 |
!! wikitext |
| 1434 |
A <ref name="x">foo</ref> |
| 1435 |
B <ref name="x" /> |
| 1436 |
<references /> |
| 1437 |
!! html/parsoid |
| 1438 |
<p>A <sup about="#mwt2" class="mw-ref reference" id="cite_ref-x_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"},"body":{"id":"mw-reference-text-cite_note-x-1"}}'><a href="./Parser_test#cite_note-x-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1439 |
B <sup about="#mwt4" class="mw-ref reference" id="cite_ref-x_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"}}'><a href="./Parser_test#cite_note-x-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1440 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1441 |
<li about="#cite_note-x-1" id="cite_note-x-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-x_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-x_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-x-1" class="mw-reference-text reference-text">foo</span></li> |
| 1442 |
</ol></div> |
| 1443 |
!! end |
| 1444 |
|
| 1445 |
!! test |
| 1446 |
Ref: 3. spaces in ref-names should be ignored |
| 1447 |
!! wikitext |
| 1448 |
A <ref name="x">foo</ref> |
| 1449 |
B <ref name=" x " /> |
| 1450 |
C <ref name= x /> |
| 1451 |
<references /> |
| 1452 |
!! html/parsoid |
| 1453 |
<p>A <sup about="#mwt2" class="mw-ref reference" id="cite_ref-x_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"},"body":{"id":"mw-reference-text-cite_note-x-1"}}'><a href="./Parser_test#cite_note-x-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1454 |
B <sup about="#mwt4" class="mw-ref reference" id="cite_ref-x_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"}}'><a href="./Parser_test#cite_note-x-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1455 |
C <sup about="#mwt6" class="mw-ref reference" id="cite_ref-x_1-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"}}'><a href="./Parser_test#cite_note-x-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1456 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1457 |
<li about="#cite_note-x-1" id="cite_note-x-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-x_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-x_1-1"><span class="mw-linkback-text">2 </span></a><a href="./Parser_test#cite_ref-x_1-2"><span class="mw-linkback-text">3 </span></a></span> <span id="mw-reference-text-cite_note-x-1" class="mw-reference-text reference-text">foo</span></li> |
| 1458 |
</ol></div> |
| 1459 |
!! end |
| 1460 |
|
| 1461 |
# NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly) |
| 1462 |
!! test |
| 1463 |
Ref: 4. 'constructor' should be accepted as a valid ref-name |
| 1464 |
!! wikitext |
| 1465 |
A <ref name="constructor">foo</ref> |
| 1466 |
<references /> |
| 1467 |
!! html/parsoid |
| 1468 |
<p>A <sup about="#mwt2" class="mw-ref reference" id="cite_ref-constructor_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"constructor"},"body":{"id":"mw-reference-text-cite_note-constructor-1"}}'><a href="./Parser_test#cite_note-constructor-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1469 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1470 |
<li about="#cite_note-constructor-1" id="cite_note-constructor-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-constructor_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-constructor-1" class="mw-reference-text reference-text">foo</span></li> |
| 1471 |
</ol></div> |
| 1472 |
!! end |
| 1473 |
|
| 1474 |
!! test |
| 1475 |
Ref: 5. body should accept generic wikitext |
| 1476 |
!! wikitext |
| 1477 |
A <ref> |
| 1478 |
This is a '''[[bolded link]]''' and this is a {{1x|transclusion}} |
| 1479 |
</ref> |
| 1480 |
|
| 1481 |
<references /> |
| 1482 |
!! html/parsoid |
| 1483 |
<p>A <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> |
| 1484 |
|
| 1485 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"> |
| 1486 |
This is a <b><a rel="mw:WikiLink" href="./Bolded_link" title="Bolded link" data-parsoid='{"stx":"simple","a":{"href":"./Bolded_link"},"sa":{"href":"bolded link"}}'>bolded link</a></b> and this is a <span about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span> |
| 1487 |
</span></li></ol></div> |
| 1488 |
!! end |
| 1489 |
|
| 1490 |
!! test |
| 1491 |
Ref: 6. indent-pres should not be output in ref-body |
| 1492 |
!! wikitext |
| 1493 |
A <ref> |
| 1494 |
foo |
| 1495 |
bar |
| 1496 |
baz |
| 1497 |
</ref> |
| 1498 |
|
| 1499 |
<references /> |
| 1500 |
!! html/parsoid |
| 1501 |
<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":{},"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> |
| 1502 |
|
| 1503 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1504 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"> |
| 1505 |
foo |
| 1506 |
bar |
| 1507 |
baz |
| 1508 |
</span></li> |
| 1509 |
</ol></div> |
| 1510 |
!! end |
| 1511 |
|
| 1512 |
!! test |
| 1513 |
Ref: 7. No p-wrapping in ref-body |
| 1514 |
!! wikitext |
| 1515 |
A <ref> |
| 1516 |
foo |
| 1517 |
|
| 1518 |
bar |
| 1519 |
|
| 1520 |
|
| 1521 |
baz |
| 1522 |
|
| 1523 |
|
| 1524 |
|
| 1525 |
booz |
| 1526 |
</ref> |
| 1527 |
|
| 1528 |
<references /> |
| 1529 |
!! html/parsoid |
| 1530 |
<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":{},"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> |
| 1531 |
|
| 1532 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1533 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"> |
| 1534 |
foo |
| 1535 |
|
| 1536 |
bar |
| 1537 |
|
| 1538 |
|
| 1539 |
baz |
| 1540 |
|
| 1541 |
|
| 1542 |
|
| 1543 |
booz |
| 1544 |
</span></li> |
| 1545 |
</ol></div> |
| 1546 |
!! end |
| 1547 |
|
| 1548 |
!! test |
| 1549 |
Ref: 8. transclusion wikitext has lower precedence |
| 1550 |
!! wikitext |
| 1551 |
A <ref> foo {{1x|</ref> B C}} |
| 1552 |
|
| 1553 |
<references /> |
| 1554 |
!! html/parsoid |
| 1555 |
<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":{},"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 C}}</p> |
| 1556 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1557 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"> foo {{1x|</span></li> |
| 1558 |
</ol></div> |
| 1559 |
!! end |
| 1560 |
|
| 1561 |
!! test |
| 1562 |
Ref: 9. unclosed comments should not leak out of ref-body |
| 1563 |
!! wikitext |
| 1564 |
A <ref> foo <!--</ref> B C |
| 1565 |
<references /> |
| 1566 |
!! html/parsoid |
| 1567 |
<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":{},"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 C</p> |
| 1568 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1569 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"> foo <!----></span></li> |
| 1570 |
</ol></div> |
| 1571 |
!! end |
| 1572 |
|
| 1573 |
!! test |
| 1574 |
Ref: 10. Unclosed HTML tags should not leak out of ref-body |
| 1575 |
!! wikitext |
| 1576 |
A <ref> <b> foo </ref> B C |
| 1577 |
|
| 1578 |
<references /> |
| 1579 |
!! html/parsoid |
| 1580 |
<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":{},"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 C</p> |
| 1581 |
|
| 1582 |
|
| 1583 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1584 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"> <b data-parsoid='{"stx":"html","autoInsertedEnd":true}'> foo </b></span></li> |
| 1585 |
</ol></div> |
| 1586 |
!! end |
| 1587 |
|
| 1588 |
!! test |
| 1589 |
Ref: 11. ref-tags acts like an inline element wrt P-wrapping |
| 1590 |
!! wikitext |
| 1591 |
A <ref>foo</ref> B |
| 1592 |
C <ref>bar</ref> D |
| 1593 |
<references /> |
| 1594 |
!! html/parsoid |
| 1595 |
<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":{},"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 |
| 1596 |
C <sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup> D</p> |
| 1597 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1598 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li> |
| 1599 |
<li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">bar</span></li> |
| 1600 |
</ol></div> |
| 1601 |
!! end |
| 1602 |
|
| 1603 |
!! test |
| 1604 |
Ref: 12. ref-tags act as trailing newline migration barrier |
| 1605 |
!! wikitext |
| 1606 |
<!--the newline at the end of this line moves out of the p tag-->a |
| 1607 |
|
| 1608 |
b<!--the newline at the end of this line stays inside the p tag--> <ref>foo</ref> |
| 1609 |
<ref>bar</ref> |
| 1610 |
|
| 1611 |
c |
| 1612 |
<references /> |
| 1613 |
!! html/parsoid |
| 1614 |
<!--the newline at the end of this line moves out of the p tag--><p>a</p> |
| 1615 |
|
| 1616 |
|
| 1617 |
<p>b<!--the newline at the end of this line stays inside the p tag--> <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;" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1618 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 1619 |
|
| 1620 |
<p>c</p> |
| 1621 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1622 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li> |
| 1623 |
<li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">bar</span></li></ol></div> |
| 1624 |
!! end |
| 1625 |
|
| 1626 |
!! test |
| 1627 |
Ref: 13. ref-tags are not SOL-transparent and block indent-pres |
| 1628 |
!! wikitext |
| 1629 |
<ref>foo</ref> A |
| 1630 |
<ref>bar |
| 1631 |
</ref> B |
| 1632 |
<references /> |
| 1633 |
!! html/parsoid |
| 1634 |
<p><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> A |
| 1635 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup> B</p> |
| 1636 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1637 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li> |
| 1638 |
<li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">bar |
| 1639 |
</span></li> |
| 1640 |
</ol></div> |
| 1641 |
!! end |
| 1642 |
|
| 1643 |
## Roundtripping fails because of nowiki'ing |
| 1644 |
!! test |
| 1645 |
Ref: 14. A nested ref-tag should be emitted as plain text |
| 1646 |
!! options |
| 1647 |
parsoid=wt2html |
| 1648 |
!! wikitext |
| 1649 |
<ref>foo <ref>bar</ref> baz</ref> |
| 1650 |
|
| 1651 |
<references /> |
| 1652 |
!! html/parsoid |
| 1653 |
<p><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> baz</ref></p> |
| 1654 |
|
| 1655 |
<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-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo <ref>bar</span></li></ol></div> |
| 1656 |
!! end |
| 1657 |
|
| 1658 |
!! test |
| 1659 |
Ref: 15. ref-tags with identical names should get identical indexes |
| 1660 |
!! wikitext |
| 1661 |
A1 <ref name="a">foo</ref> A2 <ref name="a" /> |
| 1662 |
B1 <ref name="b" /> B2 <ref name="b">bar</ref> |
| 1663 |
|
| 1664 |
<references /> |
| 1665 |
!! html/parsoid |
| 1666 |
<p>A1 <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"},"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> A2 <sup about="#mwt4" class="mw-ref reference" id="cite_ref-a_1-1" 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> |
| 1667 |
B1 <sup about="#mwt7" class="mw-ref reference" id="cite_ref-b_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"b"}}'><a href="./Parser_test#cite_note-b-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> B2 <sup about="#mwt8" class="mw-ref reference" id="cite_ref-b_2-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"b"},"body":{"id":"mw-reference-text-cite_note-b-2"}}'><a href="./Parser_test#cite_note-b-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 1668 |
|
| 1669 |
<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-a-1" id="cite_note-a-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><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></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">foo</span></li><li about="#cite_note-b-2" id="cite_note-b-2"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-b_2-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-b_2-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-b-2" class="mw-reference-text reference-text">bar</span></li> |
| 1670 |
</ol></div> |
| 1671 |
!! end |
| 1672 |
|
| 1673 |
## We don't bother wt2wt-ing non-standard whitespace |
| 1674 |
!! test |
| 1675 |
Ref: 16. Tokenizer should accept non-standard whitespace in <ref> and </ref> tags |
| 1676 |
!!options |
| 1677 |
parsoid=wt2html |
| 1678 |
!! wikitext |
| 1679 |
A <ref >foo</ref > |
| 1680 |
|
| 1681 |
<references /> |
| 1682 |
!! html/parsoid |
| 1683 |
<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":{},"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> |
| 1684 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1685 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 1686 |
!! end |
| 1687 |
|
| 1688 |
!! test |
| 1689 |
Ref: 17. Generate valid HTML5 id/about attributes |
| 1690 |
!! wikitext |
| 1691 |
<ref name="a b">foo</ref> |
| 1692 |
<ref name=":0">ve-created name</ref> |
| 1693 |
|
| 1694 |
<references /> |
| 1695 |
!! html/parsoid |
| 1696 |
<p><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> |
| 1697 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-:0_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":":0"},"body":{"id":"mw-reference-text-cite_note-:0-2"}}'><a href="./Parser_test#cite_note-:0-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 1698 |
|
| 1699 |
<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-a_b-1" id="cite_note-a_b-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_b_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a_b-1" class="mw-reference-text reference-text">foo</span></li><li about="#cite_note-:0-2" id="cite_note-:0-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-:0_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-:0-2" class="mw-reference-text reference-text">ve-created name</span></li></ol></div> |
| 1700 |
|
| 1701 |
!! end |
| 1702 |
|
| 1703 |
!! test |
| 1704 |
Ref: 18. T58916: Extension attributes should be parsed as plain text |
| 1705 |
!! config |
| 1706 |
wgFragmentMode=[ "html5", "legacy" ] |
| 1707 |
!! wikitext |
| 1708 |
<ref name="{{1x|a}}">foo</ref> |
| 1709 |
|
| 1710 |
<references /> |
| 1711 |
!! html/php |
| 1712 |
<p><sup id="cite_ref-{{1x|a}}_1-0" class="reference"><a href="#cite_note-{{1x|a}}-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1713 |
</p> |
| 1714 |
<div class="mw-references-wrap"><ol class="references"> |
| 1715 |
<li id="cite_note-{{1x|a}}-1"><span class="mw-cite-backlink"><a href="#cite_ref-{{1x|a}}_1-0">↑</a></span> <span class="reference-text">foo</span> |
| 1716 |
</li> |
| 1717 |
</ol></div> |
| 1718 |
!! html/parsoid |
| 1719 |
<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> |
| 1720 |
</p> |
| 1721 |
|
| 1722 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1723 |
<li about="#cite_ref-{{1x|a}}_1-1" id="cite_note-{{1x|a}}-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-{{1x|a}}_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-{{1x|a}}-1" class="mw-reference-text reference-text">foo</span></li> |
| 1724 |
</ol></div> |
| 1725 |
!! end |
| 1726 |
|
| 1727 |
# Parsoid doesn't wt2wt this cleanly because we serialize both |
| 1728 |
# versions of the name the same way ("a & b") |
| 1729 |
!! test |
| 1730 |
Ref: 19. ref-tags with identical name encodings should get identical indexes |
| 1731 |
!! config |
| 1732 |
wgFragmentMode=[ "html5", "legacy" ] |
| 1733 |
!! options |
| 1734 |
parsoid=wt2html,html2html |
| 1735 |
!! wikitext |
| 1736 |
1 <ref name="a & b">foo</ref> 2 <ref name="a & b" /> |
| 1737 |
|
| 1738 |
<references /> |
| 1739 |
!! html/php |
| 1740 |
<p>1 <sup id="cite_ref-a_&_b_1-0" class="reference"><a href="#cite_note-a_&_b-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> 2 <sup id="cite_ref-a_&_b_1-1" class="reference"><a href="#cite_note-a_&_b-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1741 |
</p> |
| 1742 |
<div class="mw-references-wrap"><ol class="references"> |
| 1743 |
<li id="cite_note-a_&_b-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-a_&_b_1-0">1.0</a></sup> <sup><a href="#cite_ref-a_&_b_1-1">1.1</a></sup></span> <span class="reference-text">foo</span> |
| 1744 |
</li> |
| 1745 |
</ol></div> |
| 1746 |
!! html/parsoid |
| 1747 |
<p>1 <sup about="#mwt3" 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> 2 <sup about="#mwt4" class="mw-ref reference" id="cite_ref-a_&_b_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a & b"}}'><a href="./Parser_test#cite_note-a_&_b-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1748 |
</p> |
| 1749 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1750 |
<li about="cite_note-a_&_b-1" id="cite_note-a_&_b-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_&_b_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-a_&_b_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-a_&_b-1" class="mw-reference-text reference-text">foo</span></li> |
| 1751 |
</ol></div> |
| 1752 |
!! end |
| 1753 |
|
| 1754 |
!! test |
| 1755 |
Ref: 20. ref-tags with identical names but different content should keep it |
| 1756 |
!! wikitext |
| 1757 |
A <ref name="foo">Foo one</ref> |
| 1758 |
B <ref name="foo">Foo two</ref> |
| 1759 |
C <ref name="foo" /> |
| 1760 |
|
| 1761 |
<references /> |
| 1762 |
!! html/parsoid |
| 1763 |
<p>A <sup about="#mwt2" class="mw-ref reference" id="cite_ref-foo_1-0" rel="dc:references" typeof="mw:Extension/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;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1764 |
B <sup about="#mwt6" class="mw-ref reference" id="cite_ref-foo_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"foo"},"body":{"html":"Foo two"},"errors":[{"key":"cite_error_references_duplicate_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> |
| 1765 |
C <sup about="#mwt6" class="mw-ref reference" id="cite_ref-foo_1-2" 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> |
| 1766 |
|
| 1767 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-foo-1" id="cite_note-foo-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-foo_1-1"><span class="mw-linkback-text">2 </span></a><a href="./Parser_test#cite_ref-foo_1-2"><span class="mw-linkback-text">3 </span></a></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text reference-text">Foo one</span></li> |
| 1768 |
</ol></div> |
| 1769 |
!! end |
| 1770 |
|
| 1771 |
!! test |
| 1772 |
Verify invalid use of a numeric character in a ref name |
| 1773 |
!! wikitext |
| 1774 |
PRE <ref>preValue</ref> |
| 1775 |
THEVALUE <ref name="1">theValue</ref> |
| 1776 |
POST <ref>postValue</ref> |
| 1777 |
<references /> |
| 1778 |
!! html/php |
| 1779 |
<p>PRE <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1780 |
THEVALUE <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name cannot be a simple integer. Use a descriptive title</span> |
| 1781 |
POST <sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 1782 |
</p> |
| 1783 |
<div class="mw-references-wrap"><ol class="references"> |
| 1784 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">preValue</span> |
| 1785 |
</li> |
| 1786 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">postValue</span> |
| 1787 |
</li> |
| 1788 |
</ol></div> |
| 1789 |
!! html/parsoid |
| 1790 |
<p>PRE <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> |
| 1791 |
THEVALUE <sup about="#mwt4" class="mw-ref reference" id="cite_ref-1_2-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"1"},"body":{"id":"mw-reference-text-cite_note-1-2"},"errors":[{"key":"cite_error_ref_numeric_key"}]}'><a href="./Parser_test#cite_note-1-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 1792 |
POST <sup about="#mwt6" 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 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 1793 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">preValue</span></li><li about="#cite_note-1-2" id="cite_note-1-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1-2" class="mw-reference-text reference-text">theValue</span></li><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text">postValue</span></li></ol></div> |
| 1794 |
!! end |
| 1795 |
|
| 1796 |
!! test |
| 1797 |
Verify invalid use of a numeric character in a ref name and follow |
| 1798 |
!! wikitext |
| 1799 |
<ref name="1">theValue</ref> |
| 1800 |
<ref follow="1">theFollow</ref> |
| 1801 |
<references /> |
| 1802 |
!! html/php |
| 1803 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name cannot be a simple integer. Use a descriptive title</span> |
| 1804 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name cannot be a simple integer. Use a descriptive title</span> |
| 1805 |
</p> |
| 1806 |
!! html/parsoid |
| 1807 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-1_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"1"},"body":{"id":"mw-reference-text-cite_note-1-1"},"errors":[{"key":"cite_error_ref_numeric_key"}]}'><a href="./Parser_test#cite_note-1-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 1808 |
<sup about="#mwt4" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"follow":"1"},"body":{"id":"mw-reference-text-cite_note-1-1"}}'><a href="./Parser_test#cite_note-1-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1809 |
<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-1" id="cite_note-1-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1-1" class="mw-reference-text reference-text">theValue<span typeof="mw:Cite/Follow" about="#mwt4"> theFollow</span></span></li></ol></div> |
| 1810 |
!! end |
| 1811 |
|
| 1812 |
!! test |
| 1813 |
References: 1a. references tag without any refs should be handled properly |
| 1814 |
!! wikitext |
| 1815 |
<references /> |
| 1816 |
!! html/parsoid |
| 1817 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt2" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div> |
| 1818 |
!! end |
| 1819 |
|
| 1820 |
!! test |
| 1821 |
References: 1b. references tag without any refs should be handled properly |
| 1822 |
!! wikitext |
| 1823 |
<references></references> |
| 1824 |
!! html/parsoid |
| 1825 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt2" data-mw='{"name":"references","attrs":{},"body":{"html":""}}'><ol class="mw-references references"></ol></div> |
| 1826 |
!! end |
| 1827 |
|
| 1828 |
!! test |
| 1829 |
References: 2. references tag with group only outputs references from that group |
| 1830 |
!! wikitext |
| 1831 |
A <ref group="a">foo</ref> |
| 1832 |
B <ref group="b">bar</ref> |
| 1833 |
C <ref>baz</ref> |
| 1834 |
|
| 1835 |
<references group="a" /> |
| 1836 |
<references /> |
| 1837 |
<references group="b" /> |
| 1838 |
!! html/parsoid |
| 1839 |
<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":"a"},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;" data-mw-group="a"><span class="mw-reflink-text">[a 1]</span></a></sup> |
| 1840 |
B <sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"b"},"body":{"id":"mw-reference-text-cite_note-2"}}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 1;" data-mw-group="b"><span class="mw-reflink-text">[b 1]</span></a></sup> |
| 1841 |
C <sup 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 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1842 |
|
| 1843 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{"group":"a"}}'><ol class="mw-references references" data-mw-group="a"> |
| 1844 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" data-mw-group="a" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li> |
| 1845 |
</ol></div> |
| 1846 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt10" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1847 |
<li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text">baz</span></li> |
| 1848 |
</ol></div> |
| 1849 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" data-mw='{"name":"references","attrs":{"group":"b"}}'><ol class="mw-references references" data-mw-group="b"> |
| 1850 |
<li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" data-mw-group="b" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">bar</span></li> |
| 1851 |
</ol></div> |
| 1852 |
!! end |
| 1853 |
|
| 1854 |
!! test |
| 1855 |
References: 3. ref list should be cleared after processing references |
| 1856 |
!! wikitext |
| 1857 |
A <ref>foo</ref> |
| 1858 |
|
| 1859 |
<references /> |
| 1860 |
|
| 1861 |
B <ref>bar</ref> |
| 1862 |
|
| 1863 |
<references /> |
| 1864 |
!! html |
| 1865 |
<p>A <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1866 |
</p> |
| 1867 |
<div class="mw-references-wrap"><ol class="references"> |
| 1868 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">foo</span> |
| 1869 |
</li> |
| 1870 |
</ol></div> |
| 1871 |
<p>B <sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 1872 |
</p> |
| 1873 |
<div class="mw-references-wrap"><ol class="references"> |
| 1874 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">bar</span> |
| 1875 |
</li> |
| 1876 |
</ol></div> |
| 1877 |
!! html/parsoid |
| 1878 |
<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":{},"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> |
| 1879 |
|
| 1880 |
<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-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li> |
| 1881 |
</ol></div> |
| 1882 |
|
| 1883 |
<p>B <sup about="#mwt6" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1884 |
|
| 1885 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 1886 |
<li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">bar</span></li> |
| 1887 |
</ol></div> |
| 1888 |
!! end |
| 1889 |
|
| 1890 |
!! test |
| 1891 |
Counters should be cleared after processing named <references group="…"> |
| 1892 |
!! wikitext |
| 1893 |
A <ref group="g">foo</ref> |
| 1894 |
|
| 1895 |
<references group="g" /> |
| 1896 |
|
| 1897 |
B <ref group="g">bar</ref> |
| 1898 |
|
| 1899 |
<references group="g" /> |
| 1900 |
!! html |
| 1901 |
<p>A <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>g 1<span class="cite-bracket">]</span></a></sup> |
| 1902 |
</p> |
| 1903 |
<div class="mw-references-wrap"><ol class="references"> |
| 1904 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">foo</span> |
| 1905 |
</li> |
| 1906 |
</ol></div> |
| 1907 |
<p>B <sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>g 1<span class="cite-bracket">]</span></a></sup> |
| 1908 |
</p> |
| 1909 |
<div class="mw-references-wrap"><ol class="references"> |
| 1910 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">bar</span> |
| 1911 |
</li> |
| 1912 |
</ol></div> |
| 1913 |
!! html/parsoid |
| 1914 |
<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> |
| 1915 |
|
| 1916 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 1917 |
|
| 1918 |
<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> |
| 1919 |
|
| 1920 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">bar</span></li></ol></div> |
| 1921 |
!! end |
| 1922 |
|
| 1923 |
!! test |
| 1924 |
References: 4. only referenced group should be cleared after processing references |
| 1925 |
!! wikitext |
| 1926 |
A <ref group="a">afoo</ref> |
| 1927 |
B <ref>bfoo</ref> |
| 1928 |
|
| 1929 |
<references group="a" /> |
| 1930 |
|
| 1931 |
C <ref>cfoo</ref> |
| 1932 |
|
| 1933 |
<references /> |
| 1934 |
!! html/parsoid |
| 1935 |
<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":"a"},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;" data-mw-group="a"><span class="mw-reflink-text">[a 1]</span></a></sup> |
| 1936 |
B <sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 1937 |
|
| 1938 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{"group":"a"}}'><ol class="mw-references references" data-mw-group="a"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" data-mw-group="a" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">afoo</span></li> |
| 1939 |
</ol></div> |
| 1940 |
|
| 1941 |
<p>C <sup about="#mwt8" 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> |
| 1942 |
|
| 1943 |
<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-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">bfoo</span></li><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text">cfoo</span></li> |
| 1944 |
</ol></div> |
| 1945 |
!! end |
| 1946 |
|
| 1947 |
## Don't expect this to rt since we're dropping content |
| 1948 |
!! test |
| 1949 |
References: 5. ref tags in references should be processed while ignoring all other content |
| 1950 |
!! options |
| 1951 |
parsoid=wt2html,html2html |
| 1952 |
!! wikitext |
| 1953 |
A <ref name="a" /> |
| 1954 |
B <ref name="b">bar</ref> |
| 1955 |
|
| 1956 |
<references> |
| 1957 |
<ref name="a">foo</ref> |
| 1958 |
This should just get lost. |
| 1959 |
</references> |
| 1960 |
!! html/parsoid |
| 1961 |
<p>A <sup about="#mwt2" 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> |
| 1962 |
B <sup about="#mwt4" class="mw-ref reference" id="cite_ref-b_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"b"},"body":{"id":"mw-reference-text-cite_note-b-2"}}'><a href="./Parser_test#cite_note-b-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 1963 |
|
| 1964 |
|
| 1965 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" 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\":[59,82,14,6]}' 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;\" 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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">foo</span></li><li about="#cite_note-b-2" id="cite_note-b-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-b_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-b-2" class="mw-reference-text reference-text">bar</span></li> |
| 1966 |
</ol></div> |
| 1967 |
!! end |
| 1968 |
|
| 1969 |
!! test |
| 1970 |
References: 6. <references /> from a transclusion |
| 1971 |
!! wikitext |
| 1972 |
<ref>Foo</ref> {{1x|<references />}} |
| 1973 |
!! html/php |
| 1974 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> </p><div class="mw-references-wrap"><ol class="references"> |
| 1975 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Foo</span> |
| 1976 |
</li> |
| 1977 |
</ol></div> |
| 1978 |
!! html/parsoid |
| 1979 |
<p><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> </p><div class="mw-references-wrap" typeof="mw:Extension/references mw:Transclusion" about="#mwt3" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"name":"references","attrs":{},"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"<references />"}},"i":0}}]}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">Foo</span></li></ol></div> |
| 1980 |
|
| 1981 |
!! end |
| 1982 |
|
| 1983 |
!! test |
| 1984 |
References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled |
| 1985 |
!! wikitext |
| 1986 |
A <ref>foo bar for a</ref> |
| 1987 |
B <ref group="X" name="b" /> |
| 1988 |
|
| 1989 |
<references /> |
| 1990 |
|
| 1991 |
<references group="X"> |
| 1992 |
<ref name="b">foo</ref> |
| 1993 |
</references> |
| 1994 |
!! html/parsoid |
| 1995 |
<p>A <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> |
| 1996 |
B <sup about="#mwt6" class="mw-ref reference" id="cite_ref-b_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"X","name":"b"}}'><a href="./Parser_test#cite_note-b-2" style="counter-reset: mw-Ref 1;" data-mw-group="X"><span class="mw-reflink-text">[X 1]</span></a></sup></p> |
| 1997 |
|
| 1998 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo bar for a</span></li></ol></div> |
| 1999 |
|
| 2000 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt15" data-mw='{"name":"references","attrs":{"group":"X"},"body":{"html":"\n<sup about=\"#mwt13\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[96,119,14,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"b\"},\"body\":{\"id\":\"mw-reference-text-cite_note-b-2\"}}'><a href=\"./Parser_test#cite_note-b-2\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"X\"><span class=\"mw-reflink-text\">[X 1]</span></a></sup>\n"}}'><ol class="mw-references references" data-mw-group="X"><li about="#cite_note-b-2" id="cite_note-b-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-b_2-0" data-mw-group="X" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-b-2" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 2001 |
!! end |
| 2002 |
|
| 2003 |
!! test |
| 2004 |
References: 7b. Multiple references tags some with errors should be correctly handled |
| 2005 |
!! wikitext |
| 2006 |
ALPHA<ref name="foo" /> |
| 2007 |
BETA<ref name="foo" /> |
| 2008 |
ONE<ref group="NOTES" name="foo" /> |
| 2009 |
TWO<ref group="NOTES" name="foo">food</ref> |
| 2010 |
<references group="NOTES" /> |
| 2011 |
<references /> |
| 2012 |
THREE<ref group="NOTES" name="bar">CONTENT</ref> |
| 2013 |
FOUR<ref group="NOTES" name="foo" /> |
| 2014 |
FIVE<ref group="NOTES" name="foo" /> |
| 2015 |
SIX<ref name="foo" /> |
| 2016 |
<references group="NOTES" /> |
| 2017 |
<references> |
| 2018 |
<ref name="foo">NOGROUPCONTENT</ref> |
| 2019 |
</references> |
| 2020 |
SEVEN<ref group="NOTES" name="bar" /> |
| 2021 |
EIGHT<ref group="NOTES" name="foo" /> |
| 2022 |
<references group="NOTES" /> |
| 2023 |
NINE<ref group="NOTES" name="bar">NINECONTENT</ref> |
| 2024 |
TEN<ref group="NOTES" name="foo">TENCONTENT</ref> |
| 2025 |
<references group="NOTES" /> |
| 2026 |
!! html/parsoid |
| 2027 |
<p>ALPHA<sup about="#mwt3" class="mw-ref reference" id="cite_ref-foo_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"foo"},"errors":[{"key":"cite_error_references_no_text","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> |
| 2028 |
BETA<sup about="#mwt6" class="mw-ref reference" id="cite_ref-foo_1-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"foo"},"errors":[{"key":"cite_error_references_no_text","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> |
| 2029 |
ONE<sup about="#mwt9" class="mw-ref reference" id="cite_ref-foo_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"foo"}}'><a href="./Parser_test#cite_note-foo-2" style="counter-reset: mw-Ref 1;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 1]</span></a></sup> |
| 2030 |
TWO<sup about="#mwt12" class="mw-ref reference" id="cite_ref-foo_2-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"foo"},"body":{"id":"mw-reference-text-cite_note-foo-2"}}'><a href="./Parser_test#cite_note-foo-2" style="counter-reset: mw-Ref 1;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 1]</span></a></sup></p> |
| 2031 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt15" data-mw='{"name":"references","attrs":{"group":"NOTES"}}'><ol class="mw-references references" data-mw-group="NOTES"><li about="#cite_note-foo-2" id="cite_note-foo-2"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_2-0" data-mw-group="NOTES"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-foo_2-1" data-mw-group="NOTES"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-foo-2" class="mw-reference-text reference-text">food</span></li></ol></div> |
| 2032 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt18" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-foo-1" id="cite_note-foo-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-foo_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text reference-text"></span></li></ol></div> |
| 2033 |
<p>THREE<sup about="#mwt21" class="mw-ref reference" id="cite_ref-bar_3-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"bar"},"body":{"id":"mw-reference-text-cite_note-bar-3"}}'><a href="./Parser_test#cite_note-bar-3" style="counter-reset: mw-Ref 1;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 1]</span></a></sup> |
| 2034 |
FOUR<sup about="#mwt24" class="mw-ref reference" id="cite_ref-foo_4-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"foo"},"errors":[{"key":"cite_error_references_no_text","params":["foo"]}]}'><a href="./Parser_test#cite_note-foo-4" style="counter-reset: mw-Ref 2;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 2]</span></a></sup> |
| 2035 |
FIVE<sup about="#mwt27" class="mw-ref reference" id="cite_ref-foo_4-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"foo"},"errors":[{"key":"cite_error_references_no_text","params":["foo"]}]}'><a href="./Parser_test#cite_note-foo-4" style="counter-reset: mw-Ref 2;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 2]</span></a></sup> |
| 2036 |
SIX<sup about="#mwt30" class="mw-ref reference" id="cite_ref-foo_5-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"foo"}}'><a href="./Parser_test#cite_note-foo-5" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 2037 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt33" data-mw='{"name":"references","attrs":{"group":"NOTES"}}'><ol class="mw-references references" data-mw-group="NOTES"><li about="#cite_note-bar-3" id="cite_note-bar-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-bar_3-0" data-mw-group="NOTES" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-bar-3" class="mw-reference-text reference-text">CONTENT</span></li><li about="#cite_note-foo-4" id="cite_note-foo-4"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_4-0" data-mw-group="NOTES"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-foo_4-1" data-mw-group="NOTES"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-foo-4" class="mw-reference-text reference-text"></span></li></ol></div> |
| 2038 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt39" data-mw='{"name":"references","attrs":{},"body":{"html":"\n<sup about=\"#mwt37\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[398,434,16,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"},\"body\":{\"id\":\"mw-reference-text-cite_note-foo-5\"}}'><a href=\"./Parser_test#cite_note-foo-5\" 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-5" id="cite_note-foo-5"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_5-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-5" class="mw-reference-text reference-text">NOGROUPCONTENT</span></li></ol></div> |
| 2039 |
<p>SEVEN<sup about="#mwt42" class="mw-ref reference" id="cite_ref-bar_6-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"bar"},"errors":[{"key":"cite_error_references_no_text","params":["bar"]}]}'><a href="./Parser_test#cite_note-bar-6" style="counter-reset: mw-Ref 1;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 1]</span></a></sup> |
| 2040 |
EIGHT<sup about="#mwt45" class="mw-ref reference" id="cite_ref-foo_7-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"foo"},"errors":[{"key":"cite_error_references_no_text","params":["foo"]}]}'><a href="./Parser_test#cite_note-foo-7" style="counter-reset: mw-Ref 2;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 2]</span></a></sup></p> |
| 2041 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt48" data-mw='{"name":"references","attrs":{"group":"NOTES"}}'><ol class="mw-references references" data-mw-group="NOTES"><li about="#cite_note-bar-6" id="cite_note-bar-6"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-bar_6-0" data-mw-group="NOTES" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-bar-6" class="mw-reference-text reference-text"></span></li><li about="#cite_note-foo-7" id="cite_note-foo-7"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_7-0" data-mw-group="NOTES" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-7" class="mw-reference-text reference-text"></span></li></ol></div> |
| 2042 |
<p>NINE<sup about="#mwt51" class="mw-ref reference" id="cite_ref-bar_8-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"bar"},"body":{"id":"mw-reference-text-cite_note-bar-8"}}'><a href="./Parser_test#cite_note-bar-8" style="counter-reset: mw-Ref 1;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 1]</span></a></sup> |
| 2043 |
TEN<sup about="#mwt54" class="mw-ref reference" id="cite_ref-foo_9-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"NOTES","name":"foo"},"body":{"id":"mw-reference-text-cite_note-foo-9"}}'><a href="./Parser_test#cite_note-foo-9" style="counter-reset: mw-Ref 2;" data-mw-group="NOTES"><span class="mw-reflink-text">[NOTES 2]</span></a></sup></p> |
| 2044 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt57" data-mw='{"name":"references","attrs":{"group":"NOTES"}}'><ol class="mw-references references" data-mw-group="NOTES"><li about="#cite_note-bar-8" id="cite_note-bar-8"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-bar_8-0" data-mw-group="NOTES" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-bar-8" class="mw-reference-text reference-text">NINECONTENT</span></li><li about="#cite_note-foo-9" id="cite_note-foo-9"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-foo_9-0" data-mw-group="NOTES" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-foo-9" class="mw-reference-text reference-text">TENCONTENT</span></li></ol></div> |
| 2045 |
!! end |
| 2046 |
|
| 2047 |
!! test |
| 2048 |
References: 8. T88019: Remove <meta>s from templates inside <ref> that's itself inside a template |
| 2049 |
!! wikitext |
| 2050 |
X{{1x|<ref>foo {{1x|<b>bar</b>}} and {{1x|baz}} boo</ref>}} |
| 2051 |
<references /> |
| 2052 |
!! html/parsoid |
| 2053 |
<p>X<sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"extsrc":"foo {{1x|<b>bar</b>}} and {{1x|baz}} boo"},"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"<ref>foo {{1x|<b>bar</b>}} and {{1x|baz}} boo</ref>"}},"i":0}}]}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></span></p> |
| 2054 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo <b data-parsoid='{"stx":"html"}'>bar</b> and baz boo</span></li> |
| 2055 |
</ol></div> |
| 2056 |
!! end |
| 2057 |
|
| 2058 |
!! test |
| 2059 |
References: 9. Generate missing references list at the end |
| 2060 |
!! wikitext |
| 2061 |
A <ref>foo</ref> |
| 2062 |
B <ref group="inexistent">bar</ref> |
| 2063 |
!! html/parsoid |
| 2064 |
<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> |
| 2065 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><ol class="mw-references references"> |
| 2066 |
<li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li> |
| 2067 |
</ol></div> |
| 2068 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{"group":"inexistent"},"autoGenerated":true}'><ol class="mw-references references" data-mw-group="inexistent"> |
| 2069 |
<li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" data-mw-group="inexistent" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">bar</span></li> |
| 2070 |
</ol></div> |
| 2071 |
!! end |
| 2072 |
|
| 2073 |
!! test |
| 2074 |
References: 10.1. New <references/> shouldn't be added for unrelated edits. |
| 2075 |
!! options |
| 2076 |
parsoid={ |
| 2077 |
"modes": ["selser"], |
| 2078 |
"changes": [["#x", "remove"]], |
| 2079 |
"selser": "noauto" |
| 2080 |
} |
| 2081 |
!! wikitext |
| 2082 |
Unrelated text<span id="x"> that's going to disappear</span>. |
| 2083 |
A <ref>foo</ref> |
| 2084 |
!! wikitext/edited |
| 2085 |
Unrelated text. |
| 2086 |
A <ref>foo</ref> |
| 2087 |
!! end |
| 2088 |
|
| 2089 |
!! test |
| 2090 |
References: 10.2. New <references/> shouldn't be added for unrelated edits. |
| 2091 |
!! config |
| 2092 |
wgCiteResponsiveReferences=true |
| 2093 |
wgCiteResponsiveReferencesThreshold=2 |
| 2094 |
!! options |
| 2095 |
parsoid={ |
| 2096 |
"modes": ["selser"], |
| 2097 |
"changes": [["#x", "remove"]], |
| 2098 |
"selser": "noauto" |
| 2099 |
} |
| 2100 |
!! wikitext |
| 2101 |
Unrelated text<span id="x"> that's going to disappear</span>. |
| 2102 |
A <ref>foo</ref> |
| 2103 |
!! wikitext/edited |
| 2104 |
Unrelated text. |
| 2105 |
A <ref>foo</ref> |
| 2106 |
!! end |
| 2107 |
|
| 2108 |
!! test |
| 2109 |
Grouped references with follow rendered in mixed order |
| 2110 |
!! wikitext |
| 2111 |
AA<ref group="a" name="name_a">group_a_name_a</ref> |
| 2112 |
BA<ref group="b" name="name_a">group_b_name_a</ref> |
| 2113 |
CA<ref group="c" name="name_a">group_c_name_a</ref> |
| 2114 |
BB<ref group="b" name="name_b">group_b_name_b</ref> |
| 2115 |
FBA<ref group="b" follow="name_a">group_b_follow_a</ref> |
| 2116 |
FAA<ref group="a" follow="name_a">group_a_follow_a</ref> |
| 2117 |
FBB<ref group="b" follow="name_b">group_b_follow_b</ref> |
| 2118 |
FCA<ref group="c" follow="name_a">group_c_follow_a</ref> |
| 2119 |
<references group="b" /> |
| 2120 |
<references group="c" /> |
| 2121 |
<references group="a" /> |
| 2122 |
!! html/php |
| 2123 |
<p>AA<sup id="cite_ref-name_a_1-0" class="reference"><a href="#cite_note-name_a-1"><span class="cite-bracket">[</span>a 1<span class="cite-bracket">]</span></a></sup> |
| 2124 |
BA<sup id="cite_ref-name_a_2-0" class="reference"><a href="#cite_note-name_a-2"><span class="cite-bracket">[</span>b 1<span class="cite-bracket">]</span></a></sup> |
| 2125 |
CA<sup id="cite_ref-name_a_3-0" class="reference"><a href="#cite_note-name_a-3"><span class="cite-bracket">[</span>c 1<span class="cite-bracket">]</span></a></sup> |
| 2126 |
BB<sup id="cite_ref-name_b_4-0" class="reference"><a href="#cite_note-name_b-4"><span class="cite-bracket">[</span>b 2<span class="cite-bracket">]</span></a></sup> |
| 2127 |
FBA |
| 2128 |
FAA |
| 2129 |
FBB |
| 2130 |
FCA |
| 2131 |
</p> |
| 2132 |
<div class="mw-references-wrap"><ol class="references"> |
| 2133 |
<li id="cite_note-name_a-2"><span class="mw-cite-backlink"><a href="#cite_ref-name_a_2-0">↑</a></span> <span class="reference-text">group_b_name_a group_b_follow_a</span> |
| 2134 |
</li> |
| 2135 |
<li id="cite_note-name_b-4"><span class="mw-cite-backlink"><a href="#cite_ref-name_b_4-0">↑</a></span> <span class="reference-text">group_b_name_b group_b_follow_b</span> |
| 2136 |
</li> |
| 2137 |
</ol></div> |
| 2138 |
<div class="mw-references-wrap"><ol class="references"> |
| 2139 |
<li id="cite_note-name_a-3"><span class="mw-cite-backlink"><a href="#cite_ref-name_a_3-0">↑</a></span> <span class="reference-text">group_c_name_a group_c_follow_a</span> |
| 2140 |
</li> |
| 2141 |
</ol></div> |
| 2142 |
<div class="mw-references-wrap"><ol class="references"> |
| 2143 |
<li id="cite_note-name_a-1"><span class="mw-cite-backlink"><a href="#cite_ref-name_a_1-0">↑</a></span> <span class="reference-text">group_a_name_a group_a_follow_a</span> |
| 2144 |
</li> |
| 2145 |
</ol></div> |
| 2146 |
!! html/parsoid |
| 2147 |
<p>AA<sup about="#mwt2" class="mw-ref reference" id="cite_ref-name_a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"a","name":"name_a"},"body":{"id":"mw-reference-text-cite_note-name_a-1"}}'><a href="./Parser_test#cite_note-name_a-1" style="counter-reset: mw-Ref 1;" data-mw-group="a"><span class="mw-reflink-text">[a 1]</span></a></sup> |
| 2148 |
BA<sup about="#mwt4" class="mw-ref reference" id="cite_ref-name_a_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"b","name":"name_a"},"body":{"id":"mw-reference-text-cite_note-name_a-2"}}'><a href="./Parser_test#cite_note-name_a-2" style="counter-reset: mw-Ref 1;" data-mw-group="b"><span class="mw-reflink-text">[b 1]</span></a></sup> |
| 2149 |
CA<sup about="#mwt6" class="mw-ref reference" id="cite_ref-name_a_3-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"c","name":"name_a"},"body":{"id":"mw-reference-text-cite_note-name_a-3"}}'><a href="./Parser_test#cite_note-name_a-3" style="counter-reset: mw-Ref 1;" data-mw-group="c"><span class="mw-reflink-text">[c 1]</span></a></sup> |
| 2150 |
BB<sup about="#mwt8" class="mw-ref reference" id="cite_ref-name_b_4-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"b","name":"name_b"},"body":{"id":"mw-reference-text-cite_note-name_b-4"}}'><a href="./Parser_test#cite_note-name_b-4" style="counter-reset: mw-Ref 2;" data-mw-group="b"><span class="mw-reflink-text">[b 2]</span></a></sup> |
| 2151 |
FBA<sup about="#mwt10" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"b","follow":"name_a"},"body":{"id":"mw-reference-text-cite_note-name_a-2"}}'><a href="./Parser_test#cite_note-name_a-2" style="counter-reset: mw-Ref 1;" data-mw-group="b"><span class="mw-reflink-text">[b 1]</span></a></sup> |
| 2152 |
FAA<sup about="#mwt12" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"a","follow":"name_a"},"body":{"id":"mw-reference-text-cite_note-name_a-1"}}'><a href="./Parser_test#cite_note-name_a-1" style="counter-reset: mw-Ref 1;" data-mw-group="a"><span class="mw-reflink-text">[a 1]</span></a></sup> |
| 2153 |
FBB<sup about="#mwt14" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"b","follow":"name_b"},"body":{"id":"mw-reference-text-cite_note-name_b-4"}}'><a href="./Parser_test#cite_note-name_b-4" style="counter-reset: mw-Ref 2;" data-mw-group="b"><span class="mw-reflink-text">[b 2]</span></a></sup> |
| 2154 |
FCA<sup about="#mwt16" class="mw-ref reference mw-ref-follow" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"c","follow":"name_a"},"body":{"id":"mw-reference-text-cite_note-name_a-3"}}'><a href="./Parser_test#cite_note-name_a-3" style="counter-reset: mw-Ref 1;" data-mw-group="c"><span class="mw-reflink-text">[c 1]</span></a></sup></p> |
| 2155 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt18" data-mw='{"name":"references","attrs":{"group":"b"}}'><ol class="mw-references references" data-mw-group="b"><li about="#cite_note-name_a-2" id="cite_note-name_a-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-name_a_2-0" data-mw-group="b" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-name_a-2" class="mw-reference-text reference-text">group_b_name_a<span typeof="mw:Cite/Follow" about="#mwt10"> group_b_follow_a</span></span></li><li about="#cite_note-name_b-4" id="cite_note-name_b-4"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-name_b_4-0" data-mw-group="b" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-name_b-4" class="mw-reference-text reference-text">group_b_name_b<span typeof="mw:Cite/Follow" about="#mwt14"> group_b_follow_b</span></span></li></ol></div> |
| 2156 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt20" data-mw='{"name":"references","attrs":{"group":"c"}}'><ol class="mw-references references" data-mw-group="c"><li about="#cite_note-name_a-3" id="cite_note-name_a-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-name_a_3-0" data-mw-group="c" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-name_a-3" class="mw-reference-text reference-text">group_c_name_a<span typeof="mw:Cite/Follow" about="#mwt16"> group_c_follow_a</span></span></li></ol></div> |
| 2157 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt22" data-mw='{"name":"references","attrs":{"group":"a"}}'><ol class="mw-references references" data-mw-group="a"><li about="#cite_note-name_a-1" id="cite_note-name_a-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-name_a_1-0" data-mw-group="a" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-name_a-1" class="mw-reference-text reference-text">group_a_name_a<span typeof="mw:Cite/Follow" about="#mwt12"> group_a_follow_a</span></span></li></ol></div> |
| 2158 |
!! end |
| 2159 |
|
| 2160 |
!! test |
| 2161 |
Grouped references with automatic group references generating errors |
| 2162 |
!! wikitext |
| 2163 |
GROUP <ref group="theGroup" name="theName">theValue</ref> |
| 2164 |
GROUP3 <ref group="theGroup3" name="theName3">theValue3</ref> |
| 2165 |
GROUP2 <ref group="theGroup2" name="theName2">theValue2</ref> |
| 2166 |
aDifferentNameGROUP3 <ref group="theGroup3" name="theName">anotherValue3differentName</ref> |
| 2167 |
aDifferentNameGROUP2 <ref group="theGroup2" name="anotherName2">anotherValue2DifferentName</ref> |
| 2168 |
anotherGROUP3 <ref group="theGroup3" name="theName3">anotherValue3</ref> |
| 2169 |
aDifferentNameGROUP <ref group="theGroup" name="anotherName2">anotherValueDifferentName</ref> |
| 2170 |
<references group="theGroup3" /> |
| 2171 |
!! html/php |
| 2172 |
<p>GROUP <sup id="cite_ref-theName_1-0" class="reference"><a href="#cite_note-theName-1"><span class="cite-bracket">[</span>theGroup 1<span class="cite-bracket">]</span></a></sup> |
| 2173 |
GROUP3 <sup id="cite_ref-theName3_2-0" class="reference"><a href="#cite_note-theName3-2"><span class="cite-bracket">[</span>theGroup3 1<span class="cite-bracket">]</span></a></sup> |
| 2174 |
GROUP2 <sup id="cite_ref-theName2_3-0" class="reference"><a href="#cite_note-theName2-3"><span class="cite-bracket">[</span>theGroup2 1<span class="cite-bracket">]</span></a></sup> |
| 2175 |
aDifferentNameGROUP3 <sup id="cite_ref-theName_4-0" class="reference"><a href="#cite_note-theName-4"><span class="cite-bracket">[</span>theGroup3 2<span class="cite-bracket">]</span></a></sup> |
| 2176 |
aDifferentNameGROUP2 <sup id="cite_ref-anotherName2_5-0" class="reference"><a href="#cite_note-anotherName2-5"><span class="cite-bracket">[</span>theGroup2 2<span class="cite-bracket">]</span></a></sup> |
| 2177 |
anotherGROUP3 <sup id="cite_ref-theName3_2-1" class="reference"><a href="#cite_note-theName3-2"><span class="cite-bracket">[</span>theGroup3 1<span class="cite-bracket">]</span></a></sup> |
| 2178 |
aDifferentNameGROUP <sup id="cite_ref-anotherName2_6-0" class="reference"><a href="#cite_note-anotherName2-6"><span class="cite-bracket">[</span>theGroup 2<span class="cite-bracket">]</span></a></sup> |
| 2179 |
</p> |
| 2180 |
<div class="mw-references-wrap"><ol class="references"> |
| 2181 |
<li id="cite_note-theName3-2"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-theName3_2-0">1.0</a></sup> <sup><a href="#cite_ref-theName3_2-1">1.1</a></sup></span> <span class="reference-text">theValue3 <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; name "theName3" defined multiple times with different content</span></span> |
| 2182 |
</li> |
| 2183 |
<li id="cite_note-theName-4"><span class="mw-cite-backlink"><a href="#cite_ref-theName_4-0">↑</a></span> <span class="reference-text">anotherValue3differentName</span> |
| 2184 |
</li> |
| 2185 |
</ol></div> |
| 2186 |
<p><br /><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tags exist for a group named "theGroup", but no corresponding <code><references group="theGroup"/></code> tag was found</span><br /><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tags exist for a group named "theGroup2", but no corresponding <code><references group="theGroup2"/></code> tag was found</span> |
| 2187 |
</p> |
| 2188 |
!! html/parsoid |
| 2189 |
<p>GROUP <sup about="#mwt2" class="mw-ref reference" id="cite_ref-theName_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"theGroup","name":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-1"},"errors":[{"key":"cite_error_group_refs_without_references","params":["theGroup"]}]}'><a href="./Parser_test#cite_note-theName-1" style="counter-reset: mw-Ref 1;" data-mw-group="theGroup"><span class="mw-reflink-text">[theGroup 1]</span></a></sup> |
| 2190 |
GROUP3 <sup about="#mwt4" class="mw-ref reference" id="cite_ref-theName3_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"theGroup3","name":"theName3"},"body":{"id":"mw-reference-text-cite_note-theName3-2"}}'><a href="./Parser_test#cite_note-theName3-2" style="counter-reset: mw-Ref 1;" data-mw-group="theGroup3"><span class="mw-reflink-text">[theGroup3 1]</span></a></sup> |
| 2191 |
GROUP2 <sup about="#mwt6" class="mw-ref reference" id="cite_ref-theName2_3-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"theGroup2","name":"theName2"},"body":{"id":"mw-reference-text-cite_note-theName2-3"},"errors":[{"key":"cite_error_group_refs_without_references","params":["theGroup2"]}]}'><a href="./Parser_test#cite_note-theName2-3" style="counter-reset: mw-Ref 1;" data-mw-group="theGroup2"><span class="mw-reflink-text">[theGroup2 1]</span></a></sup> |
| 2192 |
aDifferentNameGROUP3 <sup about="#mwt8" class="mw-ref reference" id="cite_ref-theName_4-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"theGroup3","name":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-4"}}'><a href="./Parser_test#cite_note-theName-4" style="counter-reset: mw-Ref 2;" data-mw-group="theGroup3"><span class="mw-reflink-text">[theGroup3 2]</span></a></sup> |
| 2193 |
aDifferentNameGROUP2 <sup about="#mwt10" class="mw-ref reference" id="cite_ref-anotherName2_5-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"theGroup2","name":"anotherName2"},"body":{"id":"mw-reference-text-cite_note-anotherName2-5"},"errors":[{"key":"cite_error_group_refs_without_references","params":["theGroup2"]}]}'><a href="./Parser_test#cite_note-anotherName2-5" style="counter-reset: mw-Ref 2;" data-mw-group="theGroup2"><span class="mw-reflink-text">[theGroup2 2]</span></a></sup> |
| 2194 |
anotherGROUP3 <sup about="#mwt12" class="mw-ref reference" id="cite_ref-theName3_2-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"theGroup3","name":"theName3"},"body":{"html":"anotherValue3"},"errors":[{"key":"cite_error_references_duplicate_key","params":["theName3"]}]}'><a href="./Parser_test#cite_note-theName3-2" style="counter-reset: mw-Ref 1;" data-mw-group="theGroup3"><span class="mw-reflink-text">[theGroup3 1]</span></a></sup> |
| 2195 |
aDifferentNameGROUP <sup about="#mwt14" class="mw-ref reference" id="cite_ref-anotherName2_6-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"group":"theGroup","name":"anotherName2"},"body":{"id":"mw-reference-text-cite_note-anotherName2-6"},"errors":[{"key":"cite_error_group_refs_without_references","params":["theGroup"]}]}'><a href="./Parser_test#cite_note-anotherName2-6" style="counter-reset: mw-Ref 2;" data-mw-group="theGroup"><span class="mw-reflink-text">[theGroup 2]</span></a></sup></p> |
| 2196 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt16" data-parsoid='{"group":"theGroup3"}' data-mw='{"name":"references","attrs":{"group":"theGroup3"}}'><ol class="mw-references references" data-mw-group="theGroup3"><li about="#cite_note-theName3-2" id="cite_note-theName3-2"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName3_2-0" data-mw-group="theGroup3"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-theName3_2-1" data-mw-group="theGroup3"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-theName3-2" class="mw-reference-text reference-text">theValue3</span></li><li about="#cite_note-theName-4" id="cite_note-theName-4"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName_4-0" data-mw-group="theGroup3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName-4" class="mw-reference-text reference-text">anotherValue3differentName</span></li></ol></div> |
| 2197 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt17" data-parsoid='{"group":"theGroup"}' data-mw='{"name":"references","attrs":{"group":"theGroup"},"autoGenerated":true}'><ol class="mw-references references" data-mw-group="theGroup"><li about="#cite_note-theName-1" id="cite_note-theName-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName_1-0" data-mw-group="theGroup" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName-1" class="mw-reference-text reference-text">theValue</span></li><li about="#cite_note-anotherName2-6" id="cite_note-anotherName2-6"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-anotherName2_6-0" data-mw-group="theGroup" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-anotherName2-6" class="mw-reference-text reference-text">anotherValueDifferentName</span></li></ol></div> |
| 2198 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt18" data-parsoid='{"group":"theGroup2"}' data-mw='{"name":"references","attrs":{"group":"theGroup2"},"autoGenerated":true}'><ol class="mw-references references" data-mw-group="theGroup2"><li about="#cite_note-theName2-3" id="cite_note-theName2-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName2_3-0" data-mw-group="theGroup2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName2-3" class="mw-reference-text reference-text">theValue2</span></li><li about="#cite_note-anotherName2-5" id="cite_note-anotherName2-5"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-anotherName2_5-0" data-mw-group="theGroup2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-anotherName2-5" class="mw-reference-text reference-text">anotherValue2DifferentName</span></li></ol></div> |
| 2199 |
!! end |
| 2200 |
|
| 2201 |
# Doesn't wt2wt cleanly because we don't encode the & in html2wt direction |
| 2202 |
!! test |
| 2203 |
Entities in ref name |
| 2204 |
!! config |
| 2205 |
wgFragmentMode=[ "html5", "legacy" ] |
| 2206 |
!! options |
| 2207 |
parsoid=wt2html,html2html |
| 2208 |
!! wikitext |
| 2209 |
<ref name="test & me {{1x|foo}}">hi</ref> |
| 2210 |
<references /> |
| 2211 |
!! html/php |
| 2212 |
<p><sup id="cite_ref-test_&_me_{{1x|foo}}_1-0" class="reference"><a href="#cite_note-test_&_me_{{1x|foo}}-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2213 |
</p> |
| 2214 |
<div class="mw-references-wrap"><ol class="references"> |
| 2215 |
<li id="cite_note-test_&_me_{{1x|foo}}-1"><span class="mw-cite-backlink"><a href="#cite_ref-test_&_me_{{1x|foo}}_1-0">↑</a></span> <span class="reference-text">hi</span> |
| 2216 |
</li> |
| 2217 |
</ol></div> |
| 2218 |
!! html/parsoid |
| 2219 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-test_&_me_{{1x|foo}}_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"test & me {{1x|foo}}"},"body":{"id":"mw-reference-text-cite_note-test_&_me_{{1x|foo}}-1"}}'><a href="./Parser_test#cite_note-test_&_me_{{1x|foo}}-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 2220 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 2221 |
<li about="#cite_note-test_&_me_{{1x|foo}}-1" id="cite_note-test_&_me_{{1x|foo}}-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-test_&_me_{{1x|foo}}_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-test_&_me_{{1x|foo}}-1" class="mw-reference-text reference-text">hi</span></li> |
| 2222 |
</ol></div> |
| 2223 |
!! end |
| 2224 |
|
| 2225 |
## The output here may look funny, but it's what the php parser will do. The |
| 2226 |
## unclosed references tag becomes escaped text, and then a new references |
| 2227 |
## tag is auto-generated. The test is wt2html only because it roundtrips with |
| 2228 |
## nowiki tags. |
| 2229 |
!! test |
| 2230 |
Generate references for unclosed references tag |
| 2231 |
!! options |
| 2232 |
parsoid=wt2html |
| 2233 |
!! wikitext |
| 2234 |
a<ref>foo</ref> |
| 2235 |
|
| 2236 |
<references> |
| 2237 |
!! html/parsoid |
| 2238 |
<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":{},"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> |
| 2239 |
|
| 2240 |
<p><references></p> |
| 2241 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 2242 |
!! end |
| 2243 |
|
| 2244 |
!! test |
| 2245 |
New reference serializes on its own line |
| 2246 |
!! options |
| 2247 |
parsoid=wt2wt,html2wt |
| 2248 |
!! wikitext |
| 2249 |
foo |
| 2250 |
<references /> |
| 2251 |
!! html/parsoid |
| 2252 |
foo<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt2" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div> |
| 2253 |
!! end |
| 2254 |
|
| 2255 |
## Ref in ref |
| 2256 |
|
| 2257 |
## The preprocessor doesn't support nested extension tags. Extensions, for |
| 2258 |
## their part, can treat portions of their content as wikitext and thus sneak |
| 2259 |
## in some nesting, the details of which are going to be extension specific. |
| 2260 |
## However, the common factor is the need to play games with transclusions |
| 2261 |
## to get around the limitations posed by the preprocessor. |
| 2262 |
|
| 2263 |
## The legacy implementation only parses the ref contents when producing the |
| 2264 |
## output for reference tags, at which point, any nested refs will be ignored. |
| 2265 |
## Parsoid mimics this behaviour. |
| 2266 |
!! test |
| 2267 |
Ref in ref: nested in top level ref |
| 2268 |
!! wikitext |
| 2269 |
test <ref>hi {{refinref|ho}}</ref> |
| 2270 |
<references /> |
| 2271 |
!! html/php |
| 2272 |
<p>test <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2273 |
</p> |
| 2274 |
<div class="mw-references-wrap"><ol class="references"> |
| 2275 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">hi </span> |
| 2276 |
</li> |
| 2277 |
</ol></div> |
| 2278 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag defined in <code><references></code> has no name attribute.</span> |
| 2279 |
</p> |
| 2280 |
!! html/parsoid |
| 2281 |
<p>test <sup about="#mwt4" 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> |
| 2282 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text 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> |
| 2283 |
!! end |
| 2284 |
|
| 2285 |
!! test |
| 2286 |
Ref in ref: top level ref nested in transclusion |
| 2287 |
!! wikitext |
| 2288 |
test {{refinref|456<ref>123</ref>}} |
| 2289 |
<references /> |
| 2290 |
!! html/php |
| 2291 |
<p>test <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2292 |
</p> |
| 2293 |
<div class="mw-references-wrap"><ol class="references"> |
| 2294 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">{{{1}}}</span> |
| 2295 |
</li> |
| 2296 |
</ol></div> |
| 2297 |
!! html/parsoid |
| 2298 |
<p>test <sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"extsrc":"{{{1}}}"},"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> |
| 2299 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt7" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"> |
| 2300 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">{{{1}}}</span></li> |
| 2301 |
</ol></div> |
| 2302 |
!! end |
| 2303 |
|
| 2304 |
## This is the common way that wikis use nested references. The reference |
| 2305 |
## in the arguments will go through extension substitution before being |
| 2306 |
## passed to the parser function so, in contrast, it'll already have been |
| 2307 |
## processed by the time the parser gets to the outer ref's contents. |
| 2308 |
!! test |
| 2309 |
Ref in ref: top level ref nested in parser function |
| 2310 |
!! wikitext |
| 2311 |
test {{#tag:ref|456<ref>123</ref>}} |
| 2312 |
<references /> |
| 2313 |
!! html/php |
| 2314 |
<p>test <sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 2315 |
</p> |
| 2316 |
<div class="mw-references-wrap"><ol class="references"> |
| 2317 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">123</span> |
| 2318 |
</li> |
| 2319 |
<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"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></span> |
| 2320 |
</li> |
| 2321 |
</ol></div> |
| 2322 |
!! html/parsoid |
| 2323 |
<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='{"name":"ref","attrs":{},"body":{"extsrc":"456<ref>123</ref>"},"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> |
| 2324 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">123</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text 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> |
| 2325 |
!! end |
| 2326 |
|
| 2327 |
!! test |
| 2328 |
Ref in ref: Multiple levels of nesting in parser function |
| 2329 |
!! wikitext |
| 2330 |
one{{#tag:ref|two{{#tag:ref|three<ref>four</ref>}}}} |
| 2331 |
!! html/php |
| 2332 |
<p>one<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> |
| 2333 |
</p> |
| 2334 |
<div class="mw-references-wrap"><ol class="references"> |
| 2335 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">four</span> |
| 2336 |
</li> |
| 2337 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">three<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></span> |
| 2338 |
</li> |
| 2339 |
<li id="cite_note-3"><span class="mw-cite-backlink"><a href="#cite_ref-3">↑</a></span> <span class="reference-text">two<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup></span> |
| 2340 |
</li> |
| 2341 |
</ol></div> |
| 2342 |
!! html/parsoid+integrated |
| 2343 |
<p>one<sup class="mw-ref reference" id="cite_ref-3" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"extsrc":"two<ref>three<ref>four</ref></ref>"},"parts":[{"template":{"target":{"wt":"#tag:ref","function":"tag"},"params":{"1":{"wt":"two{{#tag:ref|three<ref>four</ref>}}"}},"i":0}}]}'><a href="./Parser_test#cite_note-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 2344 |
<div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'> |
| 2345 |
<ol class="mw-references references"> |
| 2346 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">four</span></li> |
| 2347 |
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">three<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></span></li> |
| 2348 |
<li id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text">two<sup class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></span></li> |
| 2349 |
</ol> |
| 2350 |
</div> |
| 2351 |
!! end |
| 2352 |
|
| 2353 |
## Parsoid is choosing not to support this. |
| 2354 |
!! test |
| 2355 |
Ref in ref: self-referential |
| 2356 |
!! wikitext |
| 2357 |
{{#tag:ref|<ref name="x" />|name=x}} |
| 2358 |
!! html/php |
| 2359 |
<p><sup id="cite_ref-x_1-1" class="reference"><a href="#cite_note-x-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2360 |
</p> |
| 2361 |
<div class="mw-references-wrap"><ol class="references"> |
| 2362 |
<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"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></span> |
| 2363 |
</li> |
| 2364 |
</ol></div> |
| 2365 |
!! end |
| 2366 |
|
| 2367 |
## Bleh! Only to be used in the below. See above where the legacy parser |
| 2368 |
## wouldn't stand for this nonsense. |
| 2369 |
!! article |
| 2370 |
Template:nestedrefslash |
| 2371 |
!! text |
| 2372 |
<ref><ref name="RDEN PRE/1355/2005">three</ref></ref> |
| 2373 |
!! endarticle |
| 2374 |
|
| 2375 |
## Just a regression test for Parsoid |
| 2376 |
!! test |
| 2377 |
Nested ref with forward slash |
| 2378 |
!! wikitext |
| 2379 |
test {{nestedrefslash}} |
| 2380 |
<references /> |
| 2381 |
!! html/parsoid |
| 2382 |
<p>test <sup about="#mwt1" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"extsrc":"<ref name=\"RDEN PRE/1355/2005\">three</ref>"},"parts":[{"template":{"target":{"wt":"nestedrefslash","href":"./Template:Nestedrefslash"},"params":{},"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> |
| 2383 |
<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-RDEN_PRE/1355/2005-1" id="cite_note-RDEN_PRE/1355/2005-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-RDEN_PRE/1355/2005_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-RDEN_PRE/1355/2005-1" class="mw-reference-text reference-text">three</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text"><sup about="#mwt4" class="mw-ref reference" id="cite_ref-RDEN_PRE/1355/2005_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"RDEN PRE/1355/2005"},"body":{"id":"mw-reference-text-cite_note-RDEN_PRE/1355/2005-1"}}'><a href="./Parser_test#cite_note-RDEN_PRE/1355/2005-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></span></li></ol></div> |
| 2384 |
!! end |
| 2385 |
|
| 2386 |
## Parsoid responsive references tests |
| 2387 |
|
| 2388 |
!! test |
| 2389 |
Responsive references: disabled, autogenerated |
| 2390 |
!! config |
| 2391 |
wgCiteResponsiveReferences=false |
| 2392 |
wgCiteResponsiveReferencesThreshold=2 |
| 2393 |
!! options |
| 2394 |
parsoid={ |
| 2395 |
"modes": ["wt2html"] |
| 2396 |
} |
| 2397 |
!! wikitext |
| 2398 |
Test <ref>1</ref><ref>2</ref> |
| 2399 |
!! html/parsoid |
| 2400 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2401 |
<ol class="mw-references references" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol> |
| 2402 |
!! end |
| 2403 |
|
| 2404 |
!! test |
| 2405 |
Responsive references: enabled, autogenerated |
| 2406 |
!! config |
| 2407 |
wgCiteResponsiveReferences=true |
| 2408 |
wgCiteResponsiveReferencesThreshold=2 |
| 2409 |
!! options |
| 2410 |
parsoid={ |
| 2411 |
"modes": ["wt2html"] |
| 2412 |
} |
| 2413 |
!! wikitext |
| 2414 |
Test <ref>1</ref><ref>2</ref> |
| 2415 |
!! html/parsoid |
| 2416 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2417 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol></div> |
| 2418 |
!! end |
| 2419 |
|
| 2420 |
!! test |
| 2421 |
Responsive references: enabled, autogenerated, exceed |
| 2422 |
!! config |
| 2423 |
wgCiteResponsiveReferences=true |
| 2424 |
wgCiteResponsiveReferencesThreshold=1 |
| 2425 |
!! options |
| 2426 |
parsoid={ |
| 2427 |
"modes": ["wt2html"] |
| 2428 |
} |
| 2429 |
!! wikitext |
| 2430 |
Test <ref>1</ref><ref>2</ref> |
| 2431 |
!! html/parsoid |
| 2432 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2433 |
<div class="mw-references-wrap mw-references-columns" 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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol></div> |
| 2434 |
!! end |
| 2435 |
|
| 2436 |
!! test |
| 2437 |
Responsive references: disabled |
| 2438 |
!! config |
| 2439 |
wgCiteResponsiveReferences=false |
| 2440 |
wgCiteResponsiveReferencesThreshold=2 |
| 2441 |
!! wikitext |
| 2442 |
Test <ref>1</ref><ref>2</ref> |
| 2443 |
<references /> |
| 2444 |
!! html/parsoid |
| 2445 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2446 |
<ol class="mw-references references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol> |
| 2447 |
!! end |
| 2448 |
|
| 2449 |
!! test |
| 2450 |
Responsive references: enabled |
| 2451 |
!! config |
| 2452 |
wgCiteResponsiveReferences=true |
| 2453 |
wgCiteResponsiveReferencesThreshold=2 |
| 2454 |
!! wikitext |
| 2455 |
Test <ref>1</ref><ref>2</ref> |
| 2456 |
<references /> |
| 2457 |
!! html/parsoid |
| 2458 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2459 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol></div> |
| 2460 |
!! end |
| 2461 |
|
| 2462 |
!! test |
| 2463 |
Responsive references: enabled, exceed |
| 2464 |
!! config |
| 2465 |
wgCiteResponsiveReferences=true |
| 2466 |
wgCiteResponsiveReferencesThreshold=1 |
| 2467 |
!! wikitext |
| 2468 |
Test <ref>1</ref><ref>2</ref> |
| 2469 |
<references /> |
| 2470 |
!! html/parsoid |
| 2471 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2472 |
<div class="mw-references-wrap mw-references-columns" 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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol></div> |
| 2473 |
!! end |
| 2474 |
|
| 2475 |
!! test |
| 2476 |
Responsive references: disabled, explicit |
| 2477 |
!! config |
| 2478 |
wgCiteResponsiveReferences=false |
| 2479 |
wgCiteResponsiveReferencesThreshold=2 |
| 2480 |
!! wikitext |
| 2481 |
Test <ref>1</ref><ref>2</ref> |
| 2482 |
<references responsive="" /> |
| 2483 |
!! html/parsoid |
| 2484 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2485 |
<div class="mw-references-wrap" typeof="mw:Extension/references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{"responsive":""}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol></div> |
| 2486 |
!! end |
| 2487 |
|
| 2488 |
!! test |
| 2489 |
Responsive references: disabled, explicit, exceed |
| 2490 |
!! config |
| 2491 |
wgCiteResponsiveReferences=false |
| 2492 |
wgCiteResponsiveReferencesThreshold=1 |
| 2493 |
!! wikitext |
| 2494 |
Test <ref>1</ref><ref>2</ref> |
| 2495 |
<references responsive="" /> |
| 2496 |
!! html/parsoid |
| 2497 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2498 |
<div class="mw-references-wrap mw-references-columns" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{"responsive":""}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol></div> |
| 2499 |
!! end |
| 2500 |
|
| 2501 |
!! test |
| 2502 |
Responsive references: enabled, explicit off |
| 2503 |
!! config |
| 2504 |
wgCiteResponsiveReferences=true |
| 2505 |
wgCiteResponsiveReferencesThreshold=2 |
| 2506 |
!! wikitext |
| 2507 |
Test <ref>1</ref><ref>2</ref> |
| 2508 |
<references responsive="0" /> |
| 2509 |
!! html/parsoid |
| 2510 |
<p>Test <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="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" 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;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2511 |
<ol class="mw-references references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{"responsive":"0"}}'><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">2</span></li></ol> |
| 2512 |
!! end |
| 2513 |
|
| 2514 |
!! test |
| 2515 |
Responsive references: roundtrip templates |
| 2516 |
!! config |
| 2517 |
wgCiteResponsiveReferences=true |
| 2518 |
wgCiteResponsiveReferencesThreshold=2 |
| 2519 |
!! wikitext |
| 2520 |
test <ref>123</ref> |
| 2521 |
|
| 2522 |
{{1x|haha<references/>}} |
| 2523 |
!! html/parsoid |
| 2524 |
<p>test <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> |
| 2525 |
|
| 2526 |
<p about="#mwt4" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"haha<references/>"}},"i":0}}]}'>haha</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-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">123</span></li></ol></div> |
| 2527 |
!! end |
| 2528 |
|
| 2529 |
## End Parsoid responsive references tests |
| 2530 |
|
| 2531 |
!! article |
| 2532 |
Template:CircularRef |
| 2533 |
!! text |
| 2534 |
<ref>Hi {{CircularRef}}</ref> |
| 2535 |
!! endarticle |
| 2536 |
|
| 2537 |
!! test |
| 2538 |
CircularRef |
| 2539 |
!! wikitext |
| 2540 |
<ref>Hi {{CircularRef}}</ref> |
| 2541 |
<references /> |
| 2542 |
!! html/php |
| 2543 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2544 |
</p> |
| 2545 |
<div class="mw-references-wrap"><ol class="references"> |
| 2546 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">Hi </span> |
| 2547 |
</li> |
| 2548 |
</ol></div> |
| 2549 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag defined in <code><references></code> has no name attribute.</span> |
| 2550 |
</p> |
| 2551 |
!! html/parsoid |
| 2552 |
<p><sup about="#mwt4" 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> |
| 2553 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">Hi <span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"CircularRef","href":"./Template:CircularRef"},"params":{},"i":0}}]}'></span></span></li></ol></div> |
| 2554 |
!! end |
| 2555 |
|
| 2556 |
!! test |
| 2557 |
T15673: <ref> with direction "rtl" |
| 2558 |
!! wikitext |
| 2559 |
<ref dir="rtl">TEST</ref> |
| 2560 |
|
| 2561 |
<references /> |
| 2562 |
!! html/php |
| 2563 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2564 |
</p> |
| 2565 |
<div class="mw-references-wrap"><ol class="references"> |
| 2566 |
<li id="cite_note-1" class="mw-cite-dir-rtl"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">TEST</span> |
| 2567 |
</li> |
| 2568 |
</ol></div> |
| 2569 |
!! html/parsoid |
| 2570 |
<p><sup about="#mwt4" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"dir":"rtl"},"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> |
| 2571 |
|
| 2572 |
<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" class="mw-cite-dir-rtl"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">TEST</span></li></ol></div> |
| 2573 |
!! end |
| 2574 |
|
| 2575 |
!! test |
| 2576 |
T15673: <ref> with direction "ltr" |
| 2577 |
!! wikitext |
| 2578 |
<ref dir="ltr">TEST</ref> |
| 2579 |
|
| 2580 |
<references /> |
| 2581 |
!! html/php |
| 2582 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2583 |
</p> |
| 2584 |
<div class="mw-references-wrap"><ol class="references"> |
| 2585 |
<li id="cite_note-1" class="mw-cite-dir-ltr"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">TEST</span> |
| 2586 |
</li> |
| 2587 |
</ol></div> |
| 2588 |
!! html/parsoid |
| 2589 |
<p><sup about="#mwt4" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"dir":"ltr"},"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> |
| 2590 |
|
| 2591 |
<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" class="mw-cite-dir-ltr"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">TEST</span></li></ol></div> |
| 2592 |
!! end |
| 2593 |
|
| 2594 |
!! test |
| 2595 |
T15673: <ref> with direction "LTR", keeps upper case |
| 2596 |
!! wikitext |
| 2597 |
<ref dir="LTR">TEST</ref> |
| 2598 |
|
| 2599 |
<references /> |
| 2600 |
!! html/php |
| 2601 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2602 |
</p> |
| 2603 |
<div class="mw-references-wrap"><ol class="references"> |
| 2604 |
<li id="cite_note-1" class="mw-cite-dir-ltr"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">TEST</span> |
| 2605 |
</li> |
| 2606 |
</ol></div> |
| 2607 |
!! html/parsoid |
| 2608 |
<p><sup about="#mwt4" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"dir":"LTR"},"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> |
| 2609 |
|
| 2610 |
<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" class="mw-cite-dir-ltr"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">TEST</span></li></ol></div> |
| 2611 |
!! end |
| 2612 |
|
| 2613 |
!! test |
| 2614 |
T15673: <ref> with direction "nonsense" and "" (empty), strip invalid dir attribute and shows error |
| 2615 |
!! wikitext |
| 2616 |
<ref dir="nonsense">NONSENSE_DIR_TEST</ref> |
| 2617 |
<ref dir="">EMPTY_DIR_TEST</ref> |
| 2618 |
<references /> |
| 2619 |
!! html/php |
| 2620 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code>dir="nonsense"</code>, must be <code>ltr</code> or <code>rtl</code></span> |
| 2621 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code>dir=""</code>, must be <code>ltr</code> or <code>rtl</code></span> |
| 2622 |
</p> |
| 2623 |
!! html/parsoid |
| 2624 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"dir":"nonsense"},"body":{"id":"mw-reference-text-cite_note-1"},"errors":[{"key":"cite_error_ref_invalid_dir","params":["nonsense"]}]}'><a href="./Parser_test#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 2625 |
<sup about="#mwt4" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"dir":""},"body":{"id":"mw-reference-text-cite_note-2"},"errors":[{"key":"cite_error_ref_invalid_dir","params":[""]}]}'><a href="./Parser_test#cite_note-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 2626 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">NONSENSE_DIR_TEST</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">EMPTY_DIR_TEST</span></li></ol></div> |
| 2627 |
!! end |
| 2628 |
|
| 2629 |
!! test |
| 2630 |
T15673: Direction is supported when specifying name and group |
| 2631 |
!! wikitext |
| 2632 |
<ref dir="ltr" name="a" group="note">TEST</ref> |
| 2633 |
|
| 2634 |
<references group="note" /> |
| 2635 |
!! html/php |
| 2636 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>note 1<span class="cite-bracket">]</span></a></sup> |
| 2637 |
</p> |
| 2638 |
<div class="mw-references-wrap"><ol class="references"> |
| 2639 |
<li id="cite_note-a-1" class="mw-cite-dir-ltr"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">TEST</span> |
| 2640 |
</li> |
| 2641 |
</ol></div> |
| 2642 |
!! html/parsoid |
| 2643 |
<p><sup about="#mwt4" class="mw-ref reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"dir":"ltr","name":"a","group":"note"},"body":{"id":"mw-reference-text-cite_note-a-1"}}'><a href="./Parser_test#cite_note-a-1" style="counter-reset: mw-Ref 1;" data-mw-group="note"><span class="mw-reflink-text">[note 1]</span></a></sup></p> |
| 2644 |
|
| 2645 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{"group":"note"}}'><ol class="mw-references references" data-mw-group="note"><li about="#cite_note-a-1" id="cite_note-a-1" class="mw-cite-dir-ltr"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_1-0" data-mw-group="note" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">TEST</span></li></ol></div> |
| 2646 |
!! end |
| 2647 |
|
| 2648 |
## Just to catch regressions in Parsoid's tree-building / p-wrapping |
| 2649 |
!! test |
| 2650 |
Ref with block content in formatting tag |
| 2651 |
!! wikitext |
| 2652 |
''hi<ref><div>ho</div></ref>'' |
| 2653 |
<references /> |
| 2654 |
!! html/parsoid |
| 2655 |
<p><i>hi<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></i></p> |
| 2656 |
<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-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"><div data-parsoid='{"stx":"html"}'>ho</div></span></li></ol></div> |
| 2657 |
!! end |
| 2658 |
|
| 2659 |
!! test |
| 2660 |
T196827: Use the dir parameter only from the full definition of a named ref tag |
| 2661 |
!! wikitext |
| 2662 |
abc<ref name="r1" />def |
| 2663 |
|
| 2664 |
ghi<ref name="r1" dir="rtl">jkl</ref>mno |
| 2665 |
|
| 2666 |
<references /> |
| 2667 |
!! html/php |
| 2668 |
<p>abc<sup id="cite_ref-r1_1-0" class="reference"><a href="#cite_note-r1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>def |
| 2669 |
</p><p>ghi<sup id="cite_ref-r1_1-1" class="reference"><a href="#cite_note-r1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>mno |
| 2670 |
</p> |
| 2671 |
<div class="mw-references-wrap"><ol class="references"> |
| 2672 |
<li id="cite_note-r1-1" class="mw-cite-dir-rtl"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-r1_1-0">1.0</a></sup> <sup><a href="#cite_ref-r1_1-1">1.1</a></sup></span> <span class="reference-text">jkl</span> |
| 2673 |
</li> |
| 2674 |
</ol></div> |
| 2675 |
!! html/parsoid |
| 2676 |
<p>abc<sup about="#mwt3" class="mw-ref reference" id="cite_ref-r1_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"r1"}}'><a href="./Parser_test#cite_note-r1-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>def</p> |
| 2677 |
|
| 2678 |
<p>ghi<sup about="#mwt6" class="mw-ref reference" id="cite_ref-r1_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"r1","dir":"rtl"},"body":{"id":"mw-reference-text-cite_note-r1-1"}}'><a href="./Parser_test#cite_note-r1-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>mno</p> |
| 2679 |
|
| 2680 |
<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-r1-1" id="cite_note-r1-1" class="mw-cite-dir-rtl"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-r1_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-r1_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-r1-1" class="mw-reference-text reference-text">jkl</span></li></ol></div> |
| 2681 |
!! end |
| 2682 |
|
| 2683 |
!! test |
| 2684 |
T196827: Ignore the dir parameter from the first use, which is not a full definition, and use the dir value from the full definition of a named ref tag |
| 2685 |
!! wikitext |
| 2686 |
abc<ref name="r1" dir="rtl" />def |
| 2687 |
|
| 2688 |
ghi<ref name="r1">jkl</ref>mno |
| 2689 |
|
| 2690 |
<references /> |
| 2691 |
!! html/php |
| 2692 |
<p>abc<sup id="cite_ref-r1_1-0" class="reference"><a href="#cite_note-r1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>def |
| 2693 |
</p><p>ghi<sup id="cite_ref-r1_1-1" class="reference"><a href="#cite_note-r1-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>mno |
| 2694 |
</p> |
| 2695 |
<div class="mw-references-wrap"><ol class="references"> |
| 2696 |
<li id="cite_note-r1-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-r1_1-0">1.0</a></sup> <sup><a href="#cite_ref-r1_1-1">1.1</a></sup></span> <span class="reference-text">jkl</span> |
| 2697 |
</li> |
| 2698 |
</ol></div> |
| 2699 |
!! html/parsoid |
| 2700 |
<p>abc<sup about="#mwt3" class="mw-ref reference" id="cite_ref-r1_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"r1","dir":"rtl"}}'><a href="./Parser_test#cite_note-r1-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>def</p> |
| 2701 |
|
| 2702 |
<p>ghi<sup about="#mwt7" class="mw-ref reference" id="cite_ref-r1_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"r1"},"body":{"id":"mw-reference-text-cite_note-r1-1"}}'><a href="./Parser_test#cite_note-r1-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>mno</p> |
| 2703 |
|
| 2704 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-r1-1" id="cite_note-r1-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-r1_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-r1_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-r1-1" class="mw-reference-text reference-text">jkl</span></li></ol></div> |
| 2705 |
!! end |
| 2706 |
|
| 2707 |
!! test |
| 2708 |
Similarly named refs with identical bodies |
| 2709 |
!! wikitext |
| 2710 |
1 <ref name="one">1</ref> 2 <ref name="one">1</ref> |
| 2711 |
|
| 2712 |
<references /> |
| 2713 |
!! html/php |
| 2714 |
<p>1 <sup id="cite_ref-one_1-0" class="reference"><a href="#cite_note-one-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> 2 <sup id="cite_ref-one_1-1" class="reference"><a href="#cite_note-one-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2715 |
</p> |
| 2716 |
<div class="mw-references-wrap"><ol class="references"> |
| 2717 |
<li id="cite_note-one-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-one_1-0">1.0</a></sup> <sup><a href="#cite_ref-one_1-1">1.1</a></sup></span> <span class="reference-text">1</span> |
| 2718 |
</li> |
| 2719 |
</ol></div> |
| 2720 |
!! html/parsoid |
| 2721 |
<p>1 <sup about="#mwt3" class="mw-ref reference" id="cite_ref-one_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"one"},"body":{"id":"mw-reference-text-cite_note-one-1"}}'><a href="./Parser_test#cite_note-one-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> 2 <sup about="#mwt4" class="mw-ref reference" id="cite_ref-one_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"one"},"body":{"id":"mw-reference-text-cite_note-one-1"}}'><a href="./Parser_test#cite_note-one-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 2722 |
|
| 2723 |
<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-one-1" id="cite_note-one-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-one_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-one_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-one-1" class="mw-reference-text reference-text">1</span></li></ol></div> |
| 2724 |
!! end |
| 2725 |
|
| 2726 |
!! test |
| 2727 |
T220196 - Reference names with high-bit characters, html5 mode |
| 2728 |
!! config |
| 2729 |
wgFragmentMode=[ "html5" ] |
| 2730 |
!! wikitext |
| 2731 |
<ref name="füllen">[bar]</ref> |
| 2732 |
<references /> |
| 2733 |
!! html/php |
| 2734 |
<p><sup id="cite_ref-füllen_1-0" class="reference"><a href="#cite_note-füllen-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2735 |
</p> |
| 2736 |
<div class="mw-references-wrap"><ol class="references"> |
| 2737 |
<li id="cite_note-füllen-1"><span class="mw-cite-backlink"><a href="#cite_ref-füllen_1-0">↑</a></span> <span class="reference-text">[bar]</span> |
| 2738 |
</li> |
| 2739 |
</ol></div> |
| 2740 |
!! html/parsoid |
| 2741 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-füllen_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"füllen"},"body":{"id":"mw-reference-text-cite_note-füllen-1"}}'><a href="./Parser_test#cite_note-füllen-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 2742 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-füllen-1" id="cite_note-füllen-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-füllen_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-füllen-1" class="mw-reference-text reference-text">[bar]</span></li></ol></div> |
| 2743 |
!! end |
| 2744 |
|
| 2745 |
!! test |
| 2746 |
T220196 - Reference names with high-bit characters, legacy mode |
| 2747 |
!! config |
| 2748 |
wgFragmentMode=[ "legacy" ] |
| 2749 |
!! wikitext |
| 2750 |
<ref name="füllen">[bar]</ref> |
| 2751 |
<references /> |
| 2752 |
!! html/php |
| 2753 |
<p><sup id="cite_ref-f.C3.BCllen_1-0" class="reference"><a href="#cite_note-f.C3.BCllen-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2754 |
</p> |
| 2755 |
<div class="mw-references-wrap"><ol class="references"> |
| 2756 |
<li id="cite_note-f.C3.BCllen-1"><span class="mw-cite-backlink"><a href="#cite_ref-f.C3.BCllen_1-0">↑</a></span> <span class="reference-text">[bar]</span> |
| 2757 |
</li> |
| 2758 |
</ol></div> |
| 2759 |
!! html/parsoid |
| 2760 |
<p><sup about="#mwt2" class="mw-ref reference" id="cite_ref-füllen_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"füllen"},"body":{"id":"mw-reference-text-cite_note-füllen-1"}}'><a href="./Parser_test#cite_note-füllen-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 2761 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-füllen-1" id="cite_note-füllen-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-füllen_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-füllen-1" class="mw-reference-text reference-text">[bar]</span></li></ol></div> |
| 2762 |
!! end |
| 2763 |
|
| 2764 |
## Just a regression test |
| 2765 |
!! test |
| 2766 |
Transclusion parameter spacing is lost without data-parsoid |
| 2767 |
!! options |
| 2768 |
parsoid=wt2wt |
| 2769 |
!! wikitext |
| 2770 |
<ref>{{1x| |
| 2771 |
Hi ho |
| 2772 |
}}</ref> |
| 2773 |
|
| 2774 |
<!-- Traverse with an encapsulation where the root isn't a native extension --> |
| 2775 |
{{1x|<div><references /></div>}} |
| 2776 |
!! html/parsoid |
| 2777 |
|
| 2778 |
!! end |
| 2779 |
|
| 2780 |
!! test |
| 2781 |
T269531: Generic error message when a list-defined reference is not used in the text |
| 2782 |
!! wikitext |
| 2783 |
<references> |
| 2784 |
<ref name="foo">foo</ref> |
| 2785 |
</references> |
| 2786 |
!! html/php |
| 2787 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag with name "foo" defined in <code><references></code> is not used in prior text.</span> |
| 2788 |
</p> |
| 2789 |
!! html/parsoid |
| 2790 |
<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" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 2791 |
!! end |
| 2792 |
|
| 2793 |
!! test |
| 2794 |
T269531: Special case when a named group is entirely unused in the text |
| 2795 |
!! wikitext |
| 2796 |
<references group="g"> |
| 2797 |
<ref name="a" group="g">a</ref> |
| 2798 |
</references> |
| 2799 |
!! html/php |
| 2800 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag with name "a" defined in <code><references></code> is not used in prior text.</span> |
| 2801 |
</p> |
| 2802 |
!! html/parsoid |
| 2803 |
<div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{"group":"g"},"body":{"html":"\n<sup class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"a\",\"group\":\"g\"},\"body\":{\"id\":\"mw-reference-text-cite_note-a-1\"},\"errors\":[{\"key\":\"cite_error_references_missing_key\",\"params\":[\"a\"]}]}'><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>\n"}}'> |
| 2804 |
<ol class="mw-references references" data-mw-group="g"> |
| 2805 |
<li id="cite_note-a-1"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">a</span></li> |
| 2806 |
</ol> |
| 2807 |
</div> |
| 2808 |
!! end |
| 2809 |
|
| 2810 |
# T307741: Parsoid fails this test in both standalone and integrated modes. |
| 2811 |
!! test |
| 2812 |
T242437 - Blank ref name in #tag regression |
| 2813 |
!! wikitext |
| 2814 |
{{#tag:references| |
| 2815 |
<ref name="">foo</ref> |
| 2816 |
}} |
| 2817 |
!! html |
| 2818 |
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tag defined in <code><references></code> has no name attribute.</span> |
| 2819 |
</p> |
| 2820 |
!! end |
| 2821 |
|
| 2822 |
# While the ref numbering is identical, the ref links with Parsoid's implementation |
| 2823 |
# are different (#cite_ref-3 in Parsoid vs #cite_ref-4). Not sure why the legacy |
| 2824 |
# implementation jumps from #cite_ref-a_2-0 to #cite_ref-4 skipping 3. |
| 2825 |
# Tracked in T307741. |
| 2826 |
!! test |
| 2827 |
T48140 - Make sure rollback/redo does not consume numbers |
| 2828 |
!! wikitext |
| 2829 |
<ref>should be [1]</ref> |
| 2830 |
<ref name="a" group="g" /> |
| 2831 |
{{#tag:references| |
| 2832 |
<ref name="a">a</ref> |
| 2833 |
|group=g}} |
| 2834 |
<ref>should be [2]</ref> |
| 2835 |
!! html |
| 2836 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2837 |
<sup id="cite_ref-a_2-0" class="reference"><a href="#cite_note-a-2"><span class="cite-bracket">[</span>g 1<span class="cite-bracket">]</span></a></sup> |
| 2838 |
</p> |
| 2839 |
<div class="mw-references-wrap"><ol class="references"> |
| 2840 |
<li id="cite_note-a-2"><span class="mw-cite-backlink"><a href="#cite_ref-a_2-0">↑</a></span> <span class="reference-text">a</span> |
| 2841 |
</li> |
| 2842 |
</ol></div> |
| 2843 |
<p><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 2844 |
</p> |
| 2845 |
<div class="mw-references-wrap"><ol class="references"> |
| 2846 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">should be [1]</span> |
| 2847 |
</li> |
| 2848 |
<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> |
| 2849 |
</li> |
| 2850 |
</ol></div> |
| 2851 |
!! html/parsoid |
| 2852 |
<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> |
| 2853 |
<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> |
| 2854 |
<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='{"name":"references","attrs":{"group":"g"},"body":{"extsrc":"\n<ref name=\"a\">a</ref>\n"},"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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_2-0" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a-2" class="mw-reference-text reference-text">a</span></li></ol></div> |
| 2855 |
<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> |
| 2856 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">should be [1]</span></li><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text">should be [2]</span></li></ol></div> |
| 2857 |
!! end |
| 2858 |
|
| 2859 |
# While the ref numbering is identical, the ref links with Parsoid's implementation |
| 2860 |
# are different (#cite_ref-c_2-0 in Parsoid vs #cite_ref-c_3-0). Not sure why the |
| 2861 |
# legacy implementation jumps from a_1 to c_3 skipping 2 in between. |
| 2862 |
# Tracked in T307741. |
| 2863 |
!! test |
| 2864 |
Numbers in the default group need to start with 1, independent from other groups |
| 2865 |
!! wikitext |
| 2866 |
<ref name="a" group="g" /> |
| 2867 |
{{#tag:references| |
| 2868 |
<ref name="a">a</ref> |
| 2869 |
|group=g}} |
| 2870 |
<ref name="c">c</ref> |
| 2871 |
!! html |
| 2872 |
<p><sup id="cite_ref-a_1-0" class="reference"><a href="#cite_note-a-1"><span class="cite-bracket">[</span>g 1<span class="cite-bracket">]</span></a></sup> |
| 2873 |
</p> |
| 2874 |
<div class="mw-references-wrap"><ol class="references"> |
| 2875 |
<li id="cite_note-a-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_1-0">↑</a></span> <span class="reference-text">a</span> |
| 2876 |
</li> |
| 2877 |
</ol></div> |
| 2878 |
<p><sup id="cite_ref-c_3-0" class="reference"><a href="#cite_note-c-3"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2879 |
</p> |
| 2880 |
<div class="mw-references-wrap"><ol class="references"> |
| 2881 |
<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> |
| 2882 |
</li> |
| 2883 |
</ol></div> |
| 2884 |
!! html/parsoid |
| 2885 |
<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> |
| 2886 |
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Transclusion" about="#mwt6" data-mw='{"name":"references","attrs":{"group":"g"},"body":{"extsrc":"\n<ref name=\"a\">a</ref>\n"},"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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_1-0" data-mw-group="g" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text reference-text">a</span></li></ol></div> |
| 2887 |
<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> |
| 2888 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-c_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-c-2" class="mw-reference-text reference-text">c</span></li></ol></div> |
| 2889 |
!! end |
| 2890 |
|
| 2891 |
!! test |
| 2892 |
Serialize reference tags by themselves on a line |
| 2893 |
!! options |
| 2894 |
parsoid=html2wt |
| 2895 |
!! html/parsoid |
| 2896 |
<p>hi <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="./Main_Page#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="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Main_Page#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">ho</span></li></ol></div><p>hi ho</p> |
| 2897 |
!! wikitext |
| 2898 |
hi <ref>ho</ref> |
| 2899 |
<references /> |
| 2900 |
hi ho |
| 2901 |
!! end |
| 2902 |
|
| 2903 |
## Edge case bugs in Parsoid from T93580 |
| 2904 |
!! test |
| 2905 |
T93580: 1. Templated <ref> inside block images |
| 2906 |
!! config |
| 2907 |
wgParserEnableLegacyMediaDOM=false |
| 2908 |
!! wikitext |
| 2909 |
[[File:Foobar.jpg|thumb|Caption with templated ref: {{1x|<ref>foo</ref>}}]] |
| 2910 |
|
| 2911 |
<references /> |
| 2912 |
!! html/php |
| 2913 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/File:Foobar.jpg" class="mw-file-description"><img src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="mw-file-element" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a><figcaption>Caption with templated ref: <sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></figcaption></figure> |
| 2914 |
<div class="mw-references-wrap"><ol class="references"> |
| 2915 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">foo</span> |
| 2916 |
</li> |
| 2917 |
</ol></div> |
| 2918 |
!! html/parsoid |
| 2919 |
<figure class="mw-default-size" typeof="mw:File/Thumb"><a href="./File:Foobar.jpg" class="mw-file-description"><img resource="./File:Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" class="mw-file-element"/></a><figcaption>Caption with templated ref: <sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"name":"ref","attrs":{},"body":{"extsrc":"foo"},"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"<ref>foo</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></figcaption></figure> |
| 2920 |
|
| 2921 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 2922 |
!! end |
| 2923 |
|
| 2924 |
!! test |
| 2925 |
T93580: 2. <ref> inside inline images |
| 2926 |
!! config |
| 2927 |
wgParserEnableLegacyMediaDOM=false |
| 2928 |
!! wikitext |
| 2929 |
[[File:Foobar.jpg|Undisplayed caption in inline image with ref: <ref>foo</ref>]] |
| 2930 |
|
| 2931 |
<references /> |
| 2932 |
!! html/php |
| 2933 |
<p><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:Foobar.jpg" class="mw-file-description" title="Undisplayed caption in inline image with ref: [1]"><img alt="Undisplayed caption in inline image with ref: [1]" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="mw-file-element" /></a></span> |
| 2934 |
</p> |
| 2935 |
<div class="mw-references-wrap"><ol class="references"> |
| 2936 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">foo</span> |
| 2937 |
</li> |
| 2938 |
</ol></div> |
| 2939 |
!! html/parsoid |
| 2940 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"Undisplayed caption in inline image with ref: <ref>foo</ref>"}]}' data-mw='{"caption":"Undisplayed caption in inline image with ref: <sup about=\"#mwt2\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[64,78,5,6]}' 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>"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="Undisplayed caption in inline image with ref:"><img alt="Undisplayed caption in inline image with ref:" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 2941 |
|
| 2942 |
<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-1" id="cite_note-1"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 2943 |
!! end |
| 2944 |
|
| 2945 |
!! test |
| 2946 |
T93580: 3. Templated <ref> inside inline images |
| 2947 |
!! config |
| 2948 |
wgParserEnableLegacyMediaDOM=false |
| 2949 |
!! wikitext |
| 2950 |
[[File:Foobar.jpg|Undisplayed caption in inline image with ref: {{1x|<ref>{{1x|foo}}</ref>}}]] |
| 2951 |
|
| 2952 |
<references /> |
| 2953 |
!! html/php |
| 2954 |
<p><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:Foobar.jpg" class="mw-file-description" title="Undisplayed caption in inline image with ref: [1]"><img alt="Undisplayed caption in inline image with ref: [1]" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="mw-file-element" /></a></span> |
| 2955 |
</p> |
| 2956 |
<div class="mw-references-wrap"><ol class="references"> |
| 2957 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">foo</span> |
| 2958 |
</li> |
| 2959 |
</ol></div> |
| 2960 |
!! html/parsoid |
| 2961 |
<p><span class="mw-default-size" typeof="mw:File" data-parsoid='{"optList":[{"ck":"caption","ak":"Undisplayed caption in inline image with ref: {{1x|<ref>{{1x|foo}}</ref>}}"}]}' data-mw='{"caption":"Undisplayed caption in inline image with ref: <sup about=\"#mwt2\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Transclusion mw:Extension/ref\" data-parsoid='{\"dsr\":[64,92,null,null],\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"name\":\"ref\",\"attrs\":{},\"body\":{\"extsrc\":\"{{1x|foo}}\"},\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"&lt;ref>{{1x|foo}}&lt;/ref>\"}},\"i\":0}}]}'><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>"}'><a href="./File:Foobar.jpg" class="mw-file-description" title="Undisplayed caption in inline image with ref:"><img alt="Undisplayed caption in inline image with ref:" resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}' class="mw-file-element"/></a></span></p> |
| 2962 |
|
| 2963 |
<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"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 2964 |
!! end |
| 2965 |
|
| 2966 |
!! test |
| 2967 |
Report bad attributes in reference tags |
| 2968 |
!! wikitext |
| 2969 |
<ref>noGroupOrNameValue</ref> |
| 2970 |
<references badattrib="invalidAttribute" /> |
| 2971 |
<ref name="theName">theNameValue</ref> |
| 2972 |
<references name="theName" badattrib="invalidNameAttribute" /> |
| 2973 |
<ref group="theGroup">theGroupValue</ref> |
| 2974 |
<references group="theGroup" badattrib="invalidGroupAttribute" /> |
| 2975 |
!! html/php |
| 2976 |
<p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 2977 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code><references></code> tag</span> |
| 2978 |
<sup id="cite_ref-theName_2-0" class="reference"><a href="#cite_note-theName-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 2979 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code><references></code> tag</span> |
| 2980 |
<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>theGroup 1<span class="cite-bracket">]</span></a></sup> |
| 2981 |
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code><references></code> tag</span> |
| 2982 |
</p> |
| 2983 |
<div class="mw-references-wrap"><ol class="references"> |
| 2984 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">noGroupOrNameValue</span> |
| 2985 |
</li> |
| 2986 |
<li id="cite_note-theName-2"><span class="mw-cite-backlink"><a href="#cite_ref-theName_2-0">↑</a></span> <span class="reference-text">theNameValue</span> |
| 2987 |
</li> |
| 2988 |
</ol></div><p><br /><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code><ref></code> tags exist for a group named "theGroup", but no corresponding <code><references group="theGroup"/></code> tag was found</span></p> |
| 2989 |
!! html/parsoid |
| 2990 |
<p><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> |
| 2991 |
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Error" about="#mwt4" data-mw='{"name":"references","attrs":{"badattrib":"invalidAttribute"},"errors":[{"key":"cite_error_references_invalid_parameters"}]}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">noGroupOrNameValue</span></li></ol></div> |
| 2992 |
<p><sup about="#mwt6" class="mw-ref reference" id="cite_ref-theName_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"theName"},"body":{"id":"mw-reference-text-cite_note-theName-2"}}'><a href="./Parser_test#cite_note-theName-2" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p> |
| 2993 |
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Error" about="#mwt8" data-mw='{"name":"references","attrs":{"name":"theName","badattrib":"invalidNameAttribute"},"errors":[{"key":"cite_error_references_invalid_parameters"}]}'><ol class="mw-references references"><li about="#cite_note-theName-2" id="cite_note-theName-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-theName_2-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-theName-2" class="mw-reference-text reference-text">theNameValue</span></li></ol></div> |
| 2994 |
<p><sup about="#mwt10" class="mw-ref reference" id="cite_ref-3" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"theGroup"},"body":{"id":"mw-reference-text-cite_note-3"}}'><a href="./Parser_test#cite_note-3" style="counter-reset: mw-Ref 1;" data-mw-group="theGroup"><span class="mw-reflink-text">[theGroup 1]</span></a></sup></p> |
| 2995 |
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Error" about="#mwt12" data-parsoid='{"group":"theGroup"}' data-mw='{"name":"references","attrs":{"group":"theGroup","badattrib":"invalidGroupAttribute"},"errors":[{"key":"cite_error_references_invalid_parameters"}]}'><ol class="mw-references references" data-mw-group="theGroup"><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" data-mw-group="theGroup" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text">theGroupValue</span></li></ol></div> |
| 2996 |
!! end |
| 2997 |
|
| 2998 |
!! test |
| 2999 |
Check Cite handing of different types of whitespace in reference names |
| 3000 |
!! config |
| 3001 |
wgFragmentMode=[ "html5", "legacy" ] |
| 3002 |
!! wikitext |
| 3003 |
test space<ref name="a b">testSpaceRef</ref> |
| 3004 |
blah space<ref name="a b" /> |
| 3005 |
|
| 3006 |
test underbar<ref name="a_b">testUnderbarRef</ref> |
| 3007 |
blah underbar<ref name="a_b" /> |
| 3008 |
|
| 3009 |
test unicode u2028 whitespace<ref name="a
b">testUnicodeWhitespaceRef</ref> |
| 3010 |
blah unicode u2028 whitespace<ref name="a
b" /> |
| 3011 |
<references /> |
| 3012 |
!! html/php |
| 3013 |
<p>test space<sup id="cite_ref-a_b_1-0" class="reference"><a href="#cite_note-a_b-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 3014 |
blah space<sup id="cite_ref-a_b_1-1" class="reference"><a href="#cite_note-a_b-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 3015 |
</p><p>test underbar<sup id="cite_ref-a_b_2-0" class="reference"><a href="#cite_note-a_b-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 3016 |
blah underbar<sup id="cite_ref-a_b_2-1" class="reference"><a href="#cite_note-a_b-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> |
| 3017 |
</p><p>test unicode u2028 whitespace<sup id="cite_ref-a_b_3-0" class="reference"><a href="#cite_note-a_b-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> |
| 3018 |
blah unicode u2028 whitespace<sup id="cite_ref-a_b_3-1" class="reference"><a href="#cite_note-a_b-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> |
| 3019 |
</p> |
| 3020 |
<div class="mw-references-wrap"><ol class="references"> |
| 3021 |
<li id="cite_note-a_b-1"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-a_b_1-0">1.0</a></sup> <sup><a href="#cite_ref-a_b_1-1">1.1</a></sup></span> <span class="reference-text">testSpaceRef</span> |
| 3022 |
</li> |
| 3023 |
<li id="cite_note-a_b-2"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-a_b_2-0">2.0</a></sup> <sup><a href="#cite_ref-a_b_2-1">2.1</a></sup></span> <span class="reference-text">testUnderbarRef</span> |
| 3024 |
</li> |
| 3025 |
<li id="cite_note-a_b-3"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-a_b_3-0">3.0</a></sup> <sup><a href="#cite_ref-a_b_3-1">3.1</a></sup></span> <span class="reference-text">testUnicodeWhitespaceRef</span> |
| 3026 |
</li> |
| 3027 |
</ol></div> |
| 3028 |
!! html/parsoid |
| 3029 |
<p>test space<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> |
| 3030 |
blah space<sup about="#mwt4" class="mw-ref reference" id="cite_ref-a_b_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a b"}}'><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> |
| 3031 |
|
| 3032 |
<p>test underbar<sup about="#mwt6" class="mw-ref reference" id="cite_ref-a_b_2-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-2"}}'><a href="./Parser_test#cite_note-a_b-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 3033 |
blah underbar<sup about="#mwt8" class="mw-ref reference" id="cite_ref-a_b_2-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a_b"}}'><a href="./Parser_test#cite_note-a_b-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup></p> |
| 3034 |
|
| 3035 |
<p>test unicode u2028 whitespace<sup about="#mwt10" class="mw-ref reference" id="cite_ref-a_b_3-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a\u2028b"},"body":{"id":"mw-reference-text-cite_note-a_b-3"}}'><a href="./Parser_test#cite_note-a_b-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup> |
| 3036 |
blah unicode u2028 whitespace<sup about="#mwt12" class="mw-ref reference" id="cite_ref-a_b_3-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a\u2028b"}}'><a href="./Parser_test#cite_note-a_b-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 3037 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-a_b-1" id="cite_note-a_b-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_b_1-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-a_b_1-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-a_b-1" class="mw-reference-text reference-text">testSpaceRef</span></li><li about="#cite_note-a_b-2" id="cite_note-a_b-2"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_b_2-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-a_b_2-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-a_b-2" class="mw-reference-text reference-text">testUnderbarRef</span></li><li about="#cite_note-a_b-3" id="cite_note-a_b-3"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_b_3-0"><span class="mw-linkback-text">1 </span></a><a href="./Parser_test#cite_ref-a_b_3-1"><span class="mw-linkback-text">2 </span></a></span> <span id="mw-reference-text-cite_note-a_b-3" class="mw-reference-text reference-text">testUnicodeWhitespaceRef</span></li></ol></div> |
| 3038 |
!! end |
| 3039 |
|
| 3040 |
!! test |
| 3041 |
Check Cite handing of linefeed whitespace in reference names |
| 3042 |
!! wikitext |
| 3043 |
test linefeed<ref name="a |
| 3044 |
b">testLinefeedRef</ref> |
| 3045 |
<references /> |
| 3046 |
!! html/php |
| 3047 |
<p>test linefeed<sup id="cite_ref-a_b_1-0" class="reference"><a href="#cite_note-a_b-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> |
| 3048 |
</p> |
| 3049 |
<div class="mw-references-wrap"><ol class="references"> |
| 3050 |
<li id="cite_note-a_b-1"><span class="mw-cite-backlink"><a href="#cite_ref-a_b_1-0">↑</a></span> <span class="reference-text">testLinefeedRef</span> |
| 3051 |
</li> |
| 3052 |
</ol></div> |
| 3053 |
!! html/parsoid |
| 3054 |
<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> |
| 3055 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-a_b_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-a_b-1" class="mw-reference-text reference-text">testLinefeedRef</span></li></ol></div> |
| 3056 |
!! end |
| 3057 |
|
| 3058 |
# The legacy parser interrupts the link and adds the link without the <sup> after that. |
| 3059 |
# That behaviour breaks more things in Parsoid, so we hoist the ref link and its sup outside instead. |
| 3060 |
!! test |
| 3061 |
<ref> in a link should hoist the link outside the link (T301293) |
| 3062 |
!! options |
| 3063 |
parsoid={ |
| 3064 |
"modes": ["wt2html","selser"] |
| 3065 |
} |
| 3066 |
!! wikitext |
| 3067 |
[[Foo|''x<ref>y</ref>z'']] |
| 3068 |
!! html/parsoid |
| 3069 |
<p><a rel="mw:WikiLink" href="./Foo" title="Foo" 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-parsoid='{"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}'><span class="mw-reflink-text" data-parsoid='{"misnested":true}'>[1]</span></a></sup></p> |
| 3070 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">y</span></li></ol></div> |
| 3071 |
!! html/php |
| 3072 |
<p><a href="/wiki/Foo" title="Foo"><i>x<sup id="cite_ref-1" class="reference"></sup></i></a><i><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a>z</i> |
| 3073 |
</p> |
| 3074 |
<div class="mw-references-wrap"><ol class="references"> |
| 3075 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">y</span> |
| 3076 |
</li> |
| 3077 |
</ol></div> |
| 3078 |
!! end |
| 3079 |
|
| 3080 |
!! test |
| 3081 |
Hoisting a reference should not break template continuity |
| 3082 |
!! options |
| 3083 |
parsoid={ |
| 3084 |
"modes": ["wt2html","selser"] |
| 3085 |
} |
| 3086 |
!! wikitext |
| 3087 |
{{1x|hello [[Foo|''x<ref>y</ref>z'']] world}} |
| 3088 |
<references /> |
| 3089 |
!! html/parsoid |
| 3090 |
<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"><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>","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}'><span class="mw-reflink-text" data-parsoid='{"misnested":true}'>[1]</span></a></sup><span about="#mwt2"> world</span></p> |
| 3091 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">y</span></li></ol></div> |
| 3092 |
!! end |
| 3093 |
|
| 3094 |
!! test |
| 3095 |
Hoisting multiple references should keep references in order |
| 3096 |
!! options |
| 3097 |
parsoid={ |
| 3098 |
"modes": ["wt2html","selser"] |
| 3099 |
} |
| 3100 |
!! wikitext |
| 3101 |
[[Foo|hello <ref>note 1</ref><ref>note 2</ref>]]<ref>note 3</ref> |
| 3102 |
<references /> |
| 3103 |
!! html/parsoid |
| 3104 |
<p><a rel="mw:WikiLink" href="./Foo" title="Foo" data-parsoid='{"stx":"piped","a":{"href":"./Foo"},"sa":{"href":"Foo"}}'>hello </a><sup about="#mwt5" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"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}'><span class="mw-reflink-text" data-parsoid='{"misnested":true}'>[1]</span></a></sup><sup about="#mwt6" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"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}'><span class="mw-reflink-text" data-parsoid='{"misnested":true}'>[2]</span></a></sup><sup about="#mwt4" 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 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 3105 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt9" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">note 1</span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">note 2</span></li><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text">note 3</span></li></ol></div> |
| 3106 |
!! end |
| 3107 |
|
| 3108 |
!! test |
| 3109 |
Red links in templated references |
| 3110 |
!! wikitext |
| 3111 |
<ref>[[Not_existing_article]]</ref> |
| 3112 |
|
| 3113 |
{{1x|<references />}} |
| 3114 |
!! html/parsoid |
| 3115 |
<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> |
| 3116 |
|
| 3117 |
<div class="mw-references-wrap" typeof="mw:Extension/references mw:Transclusion" about="#mwt5" data-parsoid='{"selfClose":true,"pi":[[{"k":"1"}]]}' data-mw='{"name":"references","attrs":{},"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"<references />"}},"i":0}}]}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"><a rel="mw:WikiLink" href="./Not_existing_article?action=edit&redlink=1" title="Not existing article" class="new" typeof="mw:LocalizedAttrs" data-parsoid='{"stx":"simple","a":{"href":"./Not_existing_article"},"sa":{"href":"Not_existing_article"}}' data-mw-i18n='{"title":{"lang":"x-page","key":"red-link-title","params":["Not existing article"]}}'>Not_existing_article</a></span></li></ol></div> |
| 3118 |
!! end |
| 3119 |
|
| 3120 |
|
| 3121 |
# ->wt direction fails on this one because the first paragraph/i swallows the second one, |
| 3122 |
# and the ref is lost |
| 3123 |
!! test |
| 3124 |
Broken wikitext making a ref as extended attribute and a duplicated fragment |
| 3125 |
!! options |
| 3126 |
parsoid={ |
| 3127 |
"modes": ["wt2html"] |
| 3128 |
} |
| 3129 |
!! wikitext |
| 3130 |
<i <ref>y</ref>> |
| 3131 |
|
| 3132 |
z |
| 3133 |
<references /> |
| 3134 |
!! html/php |
| 3135 |
<p><i id="cite_ref-1" class="cite-bracket"> |
| 3136 |
</i></p><p><i id="cite_ref-1" class="cite-bracket">z |
| 3137 |
</i></p><i id="cite_ref-1" class="cite-bracket"><div class="mw-references-wrap"><ol class="references"> |
| 3138 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">y</span> |
| 3139 |
</li> |
| 3140 |
</ol></div></i> |
| 3141 |
!! html/parsoid |
| 3142 |
<p><i about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"<ref>y</ref>":null},"sa":{"<ref>y</ref>":""},"autoInsertedEnd":true}' data-mw='{"attribs":[[{"txt":"","html":""},{"html":""}]]}'></i></p><i about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"<ref>y</ref>":null},"sa":{"<ref>y</ref>":""},"autoInsertedStart":true,"autoInsertedEnd":true}' data-mw='{"attribs":[[{"txt":"","html":"<sup about=\"#mwt2\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[3,15,5,6]}' 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>"},{"html":""}]]}'> |
| 3143 |
|
| 3144 |
<p>z</p> |
| 3145 |
<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"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">y</span></li></ol></div></i> |
| 3146 |
!! end |
| 3147 |
|
| 3148 |
!! test |
| 3149 |
Broken wikitext making a ref as extended attribute and a duplicated fragment (with 2wt tests) |
| 3150 |
!! wikitext |
| 3151 |
<i title="<ref>y</ref>">a |
| 3152 |
|
| 3153 |
z |
| 3154 |
<references /> |
| 3155 |
!! html/php |
| 3156 |
<p><i title="<sup id=" class="cite-bracket">a |
| 3157 |
</i></p><p><i title="<sup id=" class="cite-bracket">z |
| 3158 |
</i></p><i title="<sup id=" class="cite-bracket"><div class="mw-references-wrap"><ol class="references"> |
| 3159 |
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">y</span> |
| 3160 |
</li> |
| 3161 |
</ol></div></i> |
| 3162 |
!! html/parsoid |
| 3163 |
<p><i title="" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"title":""},"sa":{"title":"<ref>y</ref>"},"autoInsertedEnd":true}' data-mw='{"attribs":[[{"txt":"title"},{"html":""}]]}'>a</i></p><i title="" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"title":""},"sa":{"title":"<ref>y</ref>"},"autoInsertedStart":true,"autoInsertedEnd":true}' data-mw='{"attribs":[[{"txt":"title"},{"html":"<sup about=\"#mwt2\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[10,22,5,6]}' 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>"}]]}'> |
| 3164 |
|
| 3165 |
<p>z</p> |
| 3166 |
<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"><span rel="mw:referencedBy" class="mw-cite-backlink"></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">y</span></li></ol></div></i> |
| 3167 |
!! end |
| 3168 |
|
| 3169 |
!! article |
| 3170 |
Template:PartialTable |
| 3171 |
!! text |
| 3172 |
{| |
| 3173 |
|- |
| 3174 |
!! endarticle |
| 3175 |
|
| 3176 |
## This test case is very specific to Parsoid's internals |
| 3177 |
## and is hence only tested for Parsoid's code. Parsoid uses |
| 3178 |
## a <meta> marker tag for <ref> tags and they are expanded |
| 3179 |
## much later. We are verifying that this <meta> tag usage |
| 3180 |
## doesn't prevent foster parenting. |
| 3181 |
!! test |
| 3182 |
Templates: Wiki Tables: 7. Fosterable <ref>s should get fostered |
| 3183 |
!! wikitext |
| 3184 |
{{PartialTable}}<ref>foo</ref> |
| 3185 |
|} |
| 3186 |
|
| 3187 |
<references /> |
| 3188 |
!! html/parsoid |
| 3189 |
<p about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"PartialTable","href":"./Template:PartialTable"},"params":{},"i":0}},"<ref>foo</ref>\n|}"]}'> |
| 3190 |
<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><table about="#mwt2"> |
| 3191 |
<tbody> |
| 3192 |
</tbody></table> |
| 3193 |
|
| 3194 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">foo</span></li></ol></div> |
| 3195 |
!! end |
| 3196 |
|
| 3197 |
## Note that the templates inside the references are not wrapped |
| 3198 |
!! test |
| 3199 |
Template nested in extension tag in template |
| 3200 |
!! options |
| 3201 |
title=[[Main Page]] |
| 3202 |
language=zh |
| 3203 |
!! wikitext |
| 3204 |
{{1x|hi<ref>[[ho|{{1x|hi}}]]</ref>}} |
| 3205 |
{{1x|hi<ref>[http://test.com?q={{1x|ho}}]</ref>}} |
| 3206 |
{{1x|hi<ref>-{ho|{{1x|hi}}}-</ref>}} |
| 3207 |
<references /> |
| 3208 |
!! html/parsoid |
| 3209 |
<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":"hi<ref>[[ho|{{1x|hi}}]]</ref>"}},"i":0}}]}'>hi</span><sup about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>[[ho|{{1x|hi}}]]</ref>"}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-1"}}'><a href="./Main_Page#cite_note-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup> |
| 3210 |
<span about="#mwt6" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"hi<ref>[http://test.com?q={{1x|ho}}]</ref>"}},"i":0}}]}'>hi</span><sup about="#mwt6" class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>[http://test.com?q={{1x|ho}}]</ref>"}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-2"}}'><a href="./Main_Page#cite_note-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup> |
| 3211 |
<span about="#mwt10" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"hi<ref>-{ho|{{1x|hi}}}-</ref>"}},"i":0}}]}'>hi</span><sup about="#mwt10" class="mw-ref reference" id="cite_ref-3" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>-{ho|{{1x|hi}}}-</ref>"}' data-mw='{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-3"}}'><a href="./Main_Page#cite_note-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p> |
| 3212 |
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt15" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"><li about="#cite_note-1" id="cite_note-1"><span class="mw-cite-backlink"><a href="./Main_Page#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text"><a rel="mw:WikiLink" href="./Ho" title="Ho" data-parsoid='{"stx":"piped","a":{"href":"./Ho"},"sa":{"href":"ho"}}'>hi</a></span></li><li about="#cite_note-2" id="cite_note-2"><span class="mw-cite-backlink"><a href="./Main_Page#cite_ref-2" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text"><a rel="mw:ExtLink nofollow" href="http://test.com?q=ho" class="external autonumber"></a></span></li><li about="#cite_note-3" id="cite_note-3"><span class="mw-cite-backlink"><a href="./Main_Page#cite_ref-3" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text reference-text"><span typeof="mw:LanguageVariant" data-mw-variant='{"filter":{"l":["ho"],"t":"hi"}}' data-parsoid='{"fl":["ho"]}'></span></span></li></ol></div> |
| 3213 |
!! end |
| 3214 |
|
| 3215 |
!! test |
| 3216 |
Headings: Category in ref isn't hoisted |
| 3217 |
!! options |
| 3218 |
parsoid={ |
| 3219 |
"modes": ["html2wt"] |
| 3220 |
} |
| 3221 |
!! html/parsoid |
| 3222 |
<h2> foo <span about="#mwt2" class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="./Main_Page#cite_note-1"><span class="mw-reflink-text">[1]</span></a></span> </h2> |
| 3223 |
|
| 3224 |
<ol class="references" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy" class="mw-cite-backlink"><a href="./Main_Page#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">bar <link rel="mw:PageProp/Category" href="./Category:Baz" /> </span></li></ol> |
| 3225 |
!! wikitext |
| 3226 |
== foo <ref>bar |
| 3227 |
[[Category:Baz]] </ref> == |
| 3228 |
|
| 3229 |
<references /> |
| 3230 |
!! end |
| 3231 |
|
| 3232 |
!! test |
| 3233 |
Testing serialization after deletion in references |
| 3234 |
!! options |
| 3235 |
parsoid={ |
| 3236 |
"modes": ["wt2wt"], |
| 3237 |
"changes": [ |
| 3238 |
["#x", "remove"] |
| 3239 |
] |
| 3240 |
} |
| 3241 |
!! wikitext |
| 3242 |
hi <ref><div id="x">ho</div></ref> |
| 3243 |
|
| 3244 |
<references /> |
| 3245 |
!! wikitext/edited |
| 3246 |
hi <ref></ref> |
| 3247 |
|
| 3248 |
<references /> |
| 3249 |
!! end |
| 3250 |
|
| 3251 |
!! test |
| 3252 |
Catch regression when unpacking with trailing content |
| 3253 |
!! wikitext |
| 3254 |
{{1x|Foo <references/> bar}} |
| 3255 |
!! html/parsoid |
| 3256 |
<p about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"Foo <references/> bar"}},"i":0}}]}'>Foo </p><div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt2" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references" ></ol></div><p about="#mwt2"> bar</p> |
| 3257 |
!! end |
| 3258 |
|
| 3259 |
!! test |
| 3260 |
1. DOMDiff: Changes to <ref> content should be looked up using id |
| 3261 |
!! options |
| 3262 |
parsoid={ |
| 3263 |
"modes": ["selser"], |
| 3264 |
"changes": [ |
| 3265 |
["#X", "after", "bar"], |
| 3266 |
["#Y", "after", "baz"] |
| 3267 |
] |
| 3268 |
} |
| 3269 |
!! wikitext |
| 3270 |
X <ref><span id="X">foo</span></ref> |
| 3271 |
Y <ref name="a" /> |
| 3272 |
<references> |
| 3273 |
<ref name="a"><span id="Y">foo</span></ref> |
| 3274 |
</references> |
| 3275 |
!! wikitext/edited |
| 3276 |
X <ref><span id="X">foo</span>bar</ref> |
| 3277 |
Y <ref name="a" /> |
| 3278 |
<references> |
| 3279 |
<ref name="a"><span id="Y">foo</span>baz</ref> |
| 3280 |
</references> |
| 3281 |
!! end |
| 3282 |
|
| 3283 |
!! test |
| 3284 |
2. DOMDiff: Changes to <ref> content should be looked up using id |
| 3285 |
!! options |
| 3286 |
parsoid={ |
| 3287 |
"modes": ["selser"], |
| 3288 |
"changes": [ |
| 3289 |
["#Z", "after", "bar"] |
| 3290 |
] |
| 3291 |
} |
| 3292 |
!! wikitext |
| 3293 |
A <ref>foo bar for a</ref> |
| 3294 |
B <ref group="X" name="b" /> |
| 3295 |
|
| 3296 |
<references /> |
| 3297 |
|
| 3298 |
<references group="X"> |
| 3299 |
<ref name="b"><span id="Z">foo</span></ref> |
| 3300 |
</references> |
| 3301 |
!! wikitext/edited |
| 3302 |
A <ref>foo bar for a</ref> |
| 3303 |
B <ref group="X" name="b" /> |
| 3304 |
|
| 3305 |
<references /> |
| 3306 |
|
| 3307 |
<references group="X"> |
| 3308 |
<ref name="b"><span id="Z">foo</span>bar</ref> |
| 3309 |
</references> |
| 3310 |
!! end |
| 3311 |
|
| 3312 |
!! article |
| 3313 |
Template:table_attribs_7 |
| 3314 |
!! text |
| 3315 |
<noinclude> |
| 3316 |
|</noinclude>style{{=}}"background:#f9f9f9;"|Foo<ref>foo</ref> |
| 3317 |
!! endarticle |
| 3318 |
|
| 3319 |
## Edge case fix to prevent future regressions |
| 3320 |
!! test |
| 3321 |
T107652: <ref>s in templates that also generate table cell attributes should be rendered properly |
| 3322 |
!! wikitext |
| 3323 |
{| |
| 3324 |
|{{table_attribs_7}} |
| 3325 |
|} |
| 3326 |
<references /> |
| 3327 |
!! html/parsoid |
| 3328 |
<table> |
| 3329 |
<tbody><tr><td style="background:#f9f9f9;" typeof="mw:Transclusion" about="#mwt1" data-mw='{"parts":["|",{"template":{"target":{"wt":"table_attribs_7","href":"./Template:Table_attribs_7"},"params":{},"i":0}}]}'>Foo<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></s></td></tr> |
| 3330 |
</tbody></table> |
| 3331 |
<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"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text" data-parsoid="{}">foo</span></li></ol></div> |
| 3332 |
!! end |
| 3333 |
|
| 3334 |
# FIXME: |
| 3335 |
# 1. This potentially exposes a subtle issue in the interaction between TOC, Cite, and |
| 3336 |
# localization. Parsoid doesn't localize numbers in Cite (at all!) since it relies on CSS. |
| 3337 |
# But, with the legacy parser, a wiki with localized numbers will have an anchor |
| 3338 |
# based off a localized number if a <ref> is used in a heading. Parsoid won't!. |
| 3339 |
# 2. We probably should be a bit smarter about what to strip for tags when that output |
| 3340 |
# comes from extensions. Below, we have stripped all extension typeofs and info. |
| 3341 |
# But, depends on who uses this 'line' property and how. |
| 3342 |
|
| 3343 |
!! test |
| 3344 |
Handle extension content in section headers properly |
| 3345 |
!! config |
| 3346 |
wgFragmentMode=[ "html5", "legacy" ] |
| 3347 |
!! options |
| 3348 |
nohtml |
| 3349 |
showtocdata |
| 3350 |
parsoid={ |
| 3351 |
"modes": [ "wt2html" ], |
| 3352 |
"wrapSections": true |
| 3353 |
} |
| 3354 |
!! wikitext |
| 3355 |
==c<ref>d</ref>== |
| 3356 |
!! metadata/php |
| 3357 |
Sections: |
| 3358 |
h2 index:1 toclevel:1 number:1 title:Parser_test off:0 anchor/linkAnchor:c[1] line:c<sup><span>[</span>1<span>]</span></sup> |
| 3359 |
!! metadata/parsoid |
| 3360 |
Sections: |
| 3361 |
h2 index:1 toclevel:1 number:1 title:Parser_test off:0 anchor/linkAnchor:c[1] line:c<sup><span>[1]</span></sup> |
| 3362 |
!! end |