2006-06-01 05:58:52 +00:00
|
|
|
# Force the test runner to ensure the extension is loaded
|
|
|
|
!! hooks
|
|
|
|
ref
|
|
|
|
references
|
|
|
|
!! endhooks
|
|
|
|
|
|
|
|
!! test
|
|
|
|
Simple <ref>, no <references/>
|
|
|
|
!! input
|
|
|
|
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
|
|
|
|
!! result
|
2008-03-19 20:17:57 +00:00
|
|
|
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
2006-06-01 05:58:52 +00:00
|
|
|
</p>
|
|
|
|
!! end
|
|
|
|
|
|
|
|
!! test
|
|
|
|
Simple <ref>, with <references/>
|
|
|
|
!! input
|
|
|
|
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
2008-03-19 20:17:57 +00:00
|
|
|
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
2006-06-01 05:58:52 +00:00
|
|
|
</p>
|
2008-03-19 20:17:57 +00:00
|
|
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> Proceeds of Rockology, vol. XXI</li></ol>
|
2006-06-01 05:58:52 +00:00
|
|
|
|
|
|
|
!! end
|
|
|
|
|
|
|
|
|
|
|
|
!! article
|
|
|
|
Template:Simple template
|
|
|
|
!! text
|
|
|
|
A ''simple'' template.
|
|
|
|
!! endarticle
|
|
|
|
|
|
|
|
|
|
|
|
!! test
|
|
|
|
<ref> with a simple template
|
|
|
|
!! input
|
|
|
|
Templating<ref>{{simple template}}</ref>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
2008-03-19 20:17:57 +00:00
|
|
|
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
2006-06-01 05:58:52 +00:00
|
|
|
</p>
|
2008-03-19 20:17:57 +00:00
|
|
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> A <i>simple</i> template.</li></ol>
|
2006-06-01 05:58:52 +00:00
|
|
|
|
|
|
|
!! end
|
|
|
|
|
|
|
|
!! test
|
|
|
|
<ref> with a <nowiki>
|
|
|
|
!! input
|
|
|
|
Templating<ref><nowiki>{{simple template}}</nowiki></ref>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
2008-03-19 20:17:57 +00:00
|
|
|
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
2006-06-01 05:58:52 +00:00
|
|
|
</p>
|
2008-03-19 20:17:57 +00:00
|
|
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> {{simple template}}</li></ol>
|
2006-06-01 05:58:52 +00:00
|
|
|
|
|
|
|
!! end
|
|
|
|
|
|
|
|
|
|
|
|
!! test
|
|
|
|
<ref> in a <nowiki>
|
|
|
|
!! input
|
|
|
|
Templating<nowiki><ref>{{simple template}}</ref></nowiki>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
|
|
|
<p>Templating<ref>{{simple template}}</ref>
|
2007-05-09 14:48:05 +00:00
|
|
|
</p><p><br />
|
2006-06-01 05:58:52 +00:00
|
|
|
</p>
|
|
|
|
!! end
|
|
|
|
|
|
|
|
!! test
|
|
|
|
<ref> in a <!--comment-->
|
|
|
|
!! input
|
|
|
|
Templating<!--<ref>{{simple template}}</ref>-->
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
|
|
|
<p>Templating
|
2007-05-09 14:48:05 +00:00
|
|
|
</p><p><br />
|
2006-06-01 05:58:52 +00:00
|
|
|
</p>
|
|
|
|
!! end
|
|
|
|
|
|
|
|
!! test
|
|
|
|
<!--comment--> in a <ref> (bug 5384)
|
|
|
|
!! input
|
|
|
|
Templating<ref>Text<!--comment--></ref>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
2008-03-19 20:17:57 +00:00
|
|
|
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
2006-06-01 05:58:52 +00:00
|
|
|
</p>
|
2008-03-19 20:17:57 +00:00
|
|
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> Text</li></ol>
|
2006-06-01 05:58:52 +00:00
|
|
|
|
|
|
|
!! end
|
2006-06-01 21:11:29 +00:00
|
|
|
|
|
|
|
!! test
|
|
|
|
<references> after <gallery> (bug 6164)
|
|
|
|
!! input
|
|
|
|
<ref>one</ref>
|
|
|
|
|
|
|
|
<gallery>Image:Foobar.jpg</gallery>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
2008-03-19 20:17:57 +00:00
|
|
|
<p><sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
2006-06-01 21:11:29 +00:00
|
|
|
</p>
|
2007-02-04 03:12:57 +00:00
|
|
|
<table class="gallery" cellspacing="0" cellpadding="0">
|
|
|
|
<tr>
|
2007-09-13 19:24:43 +00:00
|
|
|
<td><div class="gallerybox" style="width: 155px;">
|
2007-08-31 16:45:54 +00:00
|
|
|
<div class="thumb" style="padding: 66px 0; width: 150px;"><div style="margin-left: auto; margin-right: auto; width: 120px;"><a href="/wiki/Image:Foobar.jpg" class="image" title="Foobar.jpg"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" border="0" /></a></div></div>
|
2007-02-04 03:12:57 +00:00
|
|
|
<div class="gallerytext">
|
|
|
|
</div>
|
|
|
|
</div></td>
|
|
|
|
</tr>
|
2006-06-01 21:11:29 +00:00
|
|
|
</table>
|
2008-03-19 20:17:57 +00:00
|
|
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> one</li></ol>
|
2006-06-01 21:11:29 +00:00
|
|
|
|
|
|
|
!! end
|
2006-07-10 17:59:37 +00:00
|
|
|
|
|
|
|
!! test
|
|
|
|
{{REVISIONID}} on page with <ref> (bug 6299)
|
|
|
|
!! input
|
|
|
|
{{REVISIONID}}<ref>elite</ref>
|
|
|
|
!! result
|
2008-03-19 20:17:57 +00:00
|
|
|
<p>1337<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
2006-07-10 17:59:37 +00:00
|
|
|
</p>
|
|
|
|
!! end
|
|
|
|
|
|
|
|
!! test
|
|
|
|
{{REVISIONID}} on page without <ref> (bug 6299 sanity check)
|
|
|
|
!! input
|
|
|
|
{{REVISIONID}}
|
|
|
|
!! result
|
|
|
|
<p>1337
|
|
|
|
</p>
|
|
|
|
!! end
|
2006-11-03 15:34:46 +00:00
|
|
|
|
|
|
|
!! test
|
|
|
|
Blank ref followed by ref with content
|
|
|
|
!! input
|
|
|
|
<ref name="blank"/>
|
|
|
|
|
|
|
|
<ref name="blank">content</ref>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
2008-03-21 15:25:26 +00:00
|
|
|
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
|
|
|
</p><p><sup id="cite_ref-blank_0-1" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
2006-11-03 15:34:46 +00:00
|
|
|
</p>
|
2008-03-21 15:25:26 +00:00
|
|
|
<ol class="references"><li id="cite_note-blank-0">↑ <sup><a href="#cite_ref-blank_0-0" title="">1.0</a></sup> <sup><a href="#cite_ref-blank_0-1" title="">1.1</a></sup> content</li></ol>
|
2006-11-03 15:34:46 +00:00
|
|
|
|
|
|
|
!! end
|
|
|
|
|
|
|
|
!! test
|
|
|
|
Regression: non-blank ref "0" followed by ref with content
|
|
|
|
!! input
|
|
|
|
<ref name="blank">0</ref>
|
|
|
|
|
|
|
|
<ref name="blank">content</ref>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
2008-03-21 15:25:26 +00:00
|
|
|
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
|
|
|
</p><p><sup id="cite_ref-blank_0-1" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
2006-11-03 15:34:46 +00:00
|
|
|
</p>
|
2008-03-21 15:25:26 +00:00
|
|
|
<ol class="references"><li id="cite_note-blank-0">↑ <sup><a href="#cite_ref-blank_0-0" title="">1.0</a></sup> <sup><a href="#cite_ref-blank_0-1" title="">1.1</a></sup> 0</li></ol>
|
2006-11-03 15:34:46 +00:00
|
|
|
|
|
|
|
!! end
|
|
|
|
|
|
|
|
!! test
|
|
|
|
Regression sanity check: non-blank ref "1" followed by ref with content
|
|
|
|
!! input
|
|
|
|
<ref name="blank">1</ref>
|
|
|
|
|
|
|
|
<ref name="blank">content</ref>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
!! result
|
2008-03-21 15:25:26 +00:00
|
|
|
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
|
|
|
</p><p><sup id="cite_ref-blank_0-1" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
2006-11-03 15:34:46 +00:00
|
|
|
</p>
|
2008-03-21 15:25:26 +00:00
|
|
|
<ol class="references"><li id="cite_note-blank-0">↑ <sup><a href="#cite_ref-blank_0-0" title="">1.0</a></sup> <sup><a href="#cite_ref-blank_0-1" title="">1.1</a></sup> 1</li></ol>
|
2006-11-03 15:34:46 +00:00
|
|
|
|
|
|
|
!! end
|
2007-12-16 18:49:10 +00:00
|
|
|
|
2007-12-27 22:25:15 +00:00
|
|
|
!! test
|
|
|
|
Ref names containing a number
|
|
|
|
!! input
|
|
|
|
<ref name="test123test">One</ref>
|
|
|
|
<ref name="123test">Two</ref>
|
|
|
|
<ref name="test123">Three</ref>
|
|
|
|
|
|
|
|
<references />
|
|
|
|
!! result
|
2008-03-21 15:25:26 +00:00
|
|
|
<p><sup id="cite_ref-test123test_0-0" class="reference"><a href="#cite_note-test123test-0" title="">[1]</a></sup>
|
|
|
|
<sup id="cite_ref-123test_1-0" class="reference"><a href="#cite_note-123test-1" title="">[2]</a></sup>
|
|
|
|
<sup id="cite_ref-test123_2-0" class="reference"><a href="#cite_note-test123-2" title="">[3]</a></sup>
|
2007-12-27 22:25:15 +00:00
|
|
|
</p>
|
2008-03-21 15:25:26 +00:00
|
|
|
<ol class="references"><li id="cite_note-test123test-0"><a href="#cite_ref-test123test_0-0" title="">↑</a> One</li>
|
|
|
|
<li id="cite_note-123test-1"><a href="#cite_ref-123test_1-0" title="">↑</a> Two</li>
|
|
|
|
<li id="cite_note-test123-2"><a href="#cite_ref-test123_2-0" title="">↑</a> Three</li></ol>
|
2007-12-27 22:25:15 +00:00
|
|
|
|
|
|
|
!! end
|
|
|
|
|
2007-12-16 18:49:10 +00:00
|
|
|
!! test
|
|
|
|
Erroneous refs
|
|
|
|
!! input
|
|
|
|
<ref name="0">Zero</ref>
|
|
|
|
|
|
|
|
<ref>Also zero, but differently! (Normal ref)</ref>
|
|
|
|
|
|
|
|
<ref />
|
|
|
|
|
|
|
|
<ref name="foo" name="bar" />
|
|
|
|
|
|
|
|
<ref name="blankwithnoreference" />
|
|
|
|
|
|
|
|
<references>I'm a references with something to say!</references>
|
|
|
|
|
|
|
|
<references name="quasit" />
|
|
|
|
|
|
|
|
<references />
|
|
|
|
!! result
|
2008-04-18 22:48:57 +00:00
|
|
|
<p><strong class="error">Cite error: Invalid <code><ref></code> tag;
|
|
|
|
name cannot be a simple integer. Use a descriptive title</strong>
|
2008-03-19 20:17:57 +00:00
|
|
|
</p><p><sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
2008-04-18 22:48:57 +00:00
|
|
|
</p><p><strong class="error">Cite error: Invalid <code><ref></code> tag;
|
|
|
|
refs with no content must have a name</strong>
|
2008-03-21 15:25:26 +00:00
|
|
|
</p><p><sup id="cite_ref-bar_1-0" class="reference"><a href="#cite_note-bar-1" title="">[2]</a></sup>
|
|
|
|
</p><p><sup id="cite_ref-blankwithnoreference_2-0" class="reference"><a href="#cite_note-blankwithnoreference-2" title="">[3]</a></sup>
|
2008-04-18 22:48:57 +00:00
|
|
|
</p><p><strong class="error">Cite error: Invalid <code><references></code> tag;
|
|
|
|
no input is allowed. Use <code><references /></code></strong>
|
|
|
|
</p><p><strong class="error">Cite error: Invalid <code><references></code> tag;
|
|
|
|
no parameters are allowed.
|
|
|
|
Use <code><references /></code></strong>
|
2007-12-16 18:49:10 +00:00
|
|
|
</p>
|
2008-03-19 20:17:57 +00:00
|
|
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> Also zero, but differently! (Normal ref)</li>
|
2008-04-18 22:48:57 +00:00
|
|
|
<li id="cite_note-bar"><a href="#cite_ref-bar_0" title="">↑</a> <strong class="error">Cite error: Invalid <code><ref></code> tag;
|
|
|
|
no text was provided for refs named <code>bar</code></strong></li>
|
|
|
|
<li id="cite_note-blankwithnoreference"><a href="#cite_ref-blankwithnoreference_0" title="">↑</a> <strong class="error">Cite error: Invalid <code><ref></code> tag;
|
|
|
|
no text was provided for refs named <code>blankwithnoreference</code></strong></li></ol>
|
2007-12-16 18:49:10 +00:00
|
|
|
|
|
|
|
!! end
|
|
|
|
|
2007-12-16 20:18:33 +00:00
|
|
|
|
2008-03-21 15:25:26 +00:00
|
|
|
!! test
|
|
|
|
Simple <ref>, with <references/> in group
|
|
|
|
!! input
|
|
|
|
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
|
|
|
|
Wikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>
|
|
|
|
|
|
|
|
<references/>
|
|
|
|
<references group=note/>
|
|
|
|
!! result
|
|
|
|
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
|
|
|
Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1" title="">[note 1]</a></sup>
|
|
|
|
</p>
|
|
|
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> Proceeds of Rockology, vol. XXI</li></ol>
|
|
|
|
<ol class="references"><li id="cite_note-1"><a href="#cite_ref-1" title="">↑</a> Proceeds of Rockology, vol. XXI</li></ol>
|
|
|
|
|
|
|
|
!! end
|