mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CiteThisPage
synced 2024-12-12 15:55:12 +00:00
Don't add empty title attributes to anchor links
All parser tests updated.
This commit is contained in:
parent
87d06b1ef4
commit
245673a16c
|
@ -9,7 +9,7 @@ Simple <ref>, no <references/>
|
||||||
!! input
|
!! input
|
||||||
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
|
Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
|
||||||
!! result
|
!! result
|
||||||
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<br /><strong class="error">Cite error: <code><ref></code> tags exist, but no <code><references/></code> tag was found</strong>
|
<br /><strong class="error">Cite error: <code><ref></code> tags exist, but no <code><references/></code> tag was found</strong>
|
||||||
!! end
|
!! end
|
||||||
|
@ -21,9 +21,9 @@ Wikipedia rocks!<ref>Proceeds of Rockology, vol. XXI</ref>
|
||||||
|
|
||||||
<references/>
|
<references/>
|
||||||
!! result
|
!! result
|
||||||
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
</p>
|
</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-0"><a href="#cite_ref-0">↑</a> Proceeds of Rockology, vol. XXI</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ Templating<ref>{{simple template}}</ref>
|
||||||
|
|
||||||
<references/>
|
<references/>
|
||||||
!! result
|
!! result
|
||||||
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> A <i>simple</i> template.</li></ol>
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0">↑</a> A <i>simple</i> template.</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@ Templating<ref><nowiki>{{simple template}}</nowiki></ref>
|
||||||
|
|
||||||
<references/>
|
<references/>
|
||||||
!! result
|
!! result
|
||||||
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> {{simple template}}</li></ol>
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0">↑</a> {{simple template}}</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -93,9 +93,9 @@ Templating<ref>Text<!--comment--></ref>
|
||||||
|
|
||||||
<references/>
|
<references/>
|
||||||
!! result
|
!! result
|
||||||
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
<p>Templating<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> Text</li></ol>
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0">↑</a> Text</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ Templating<ref>Text<!--comment--></ref>
|
||||||
|
|
||||||
<references/>
|
<references/>
|
||||||
!! result
|
!! result
|
||||||
<p><sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
<p><sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<table class="gallery" cellspacing="0" cellpadding="0">
|
<table class="gallery" cellspacing="0" cellpadding="0">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -119,7 +119,7 @@ Templating<ref>Text<!--comment--></ref>
|
||||||
</div></td>
|
</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> one</li></ol>
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0">↑</a> one</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ Templating<ref>Text<!--comment--></ref>
|
||||||
!! input
|
!! input
|
||||||
{{REVISIONID}}<ref>elite</ref>
|
{{REVISIONID}}<ref>elite</ref>
|
||||||
!! result
|
!! result
|
||||||
<p>1337<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
<p>1337<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<br /><strong class="error">Cite error: <code><ref></code> tags exist, but no <code><references/></code> tag was found</strong>
|
<br /><strong class="error">Cite error: <code><ref></code> tags exist, but no <code><references/></code> tag was found</strong>
|
||||||
!! end
|
!! end
|
||||||
|
@ -151,10 +151,10 @@ Blank ref followed by ref with content
|
||||||
|
|
||||||
<references/>
|
<references/>
|
||||||
!! result
|
!! result
|
||||||
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0">[1]</a></sup>
|
||||||
</p><p><sup id="cite_ref-blank_0-1" 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">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<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>
|
<ol class="references"><li id="cite_note-blank-0">↑ <sup><a href="#cite_ref-blank_0-0">1.0</a></sup> <sup><a href="#cite_ref-blank_0-1">1.1</a></sup> content</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -167,10 +167,10 @@ Regression: non-blank ref "0" followed by ref with content
|
||||||
|
|
||||||
<references/>
|
<references/>
|
||||||
!! result
|
!! result
|
||||||
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0">[1]</a></sup>
|
||||||
</p><p><sup id="cite_ref-blank_0-1" 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">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<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>
|
<ol class="references"><li id="cite_note-blank-0">↑ <sup><a href="#cite_ref-blank_0-0">1.0</a></sup> <sup><a href="#cite_ref-blank_0-1">1.1</a></sup> 0</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -183,10 +183,10 @@ Regression sanity check: non-blank ref "1" followed by ref with content
|
||||||
|
|
||||||
<references/>
|
<references/>
|
||||||
!! result
|
!! result
|
||||||
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0" title="">[1]</a></sup>
|
<p><sup id="cite_ref-blank_0-0" class="reference"><a href="#cite_note-blank-0">[1]</a></sup>
|
||||||
</p><p><sup id="cite_ref-blank_0-1" 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">[1]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<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>
|
<ol class="references"><li id="cite_note-blank-0">↑ <sup><a href="#cite_ref-blank_0-0">1.0</a></sup> <sup><a href="#cite_ref-blank_0-1">1.1</a></sup> 1</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -199,13 +199,13 @@ Ref names containing a number
|
||||||
|
|
||||||
<references />
|
<references />
|
||||||
!! result
|
!! result
|
||||||
<p><sup id="cite_ref-test123test_0-0" class="reference"><a href="#cite_note-test123test-0" title="">[1]</a></sup>
|
<p><sup id="cite_ref-test123test_0-0" class="reference"><a href="#cite_note-test123test-0">[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-123test_1-0" class="reference"><a href="#cite_note-123test-1">[2]</a></sup>
|
||||||
<sup id="cite_ref-test123_2-0" class="reference"><a href="#cite_note-test123-2" title="">[3]</a></sup>
|
<sup id="cite_ref-test123_2-0" class="reference"><a href="#cite_note-test123-2">[3]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<ol class="references"><li id="cite_note-test123test-0"><a href="#cite_ref-test123test_0-0" title="">↑</a> One</li>
|
<ol class="references"><li id="cite_note-test123test-0"><a href="#cite_ref-test123test_0-0">↑</a> One</li>
|
||||||
<li id="cite_note-123test-1"><a href="#cite_ref-123test_1-0" title="">↑</a> Two</li>
|
<li id="cite_note-123test-1"><a href="#cite_ref-123test_1-0">↑</a> Two</li>
|
||||||
<li id="cite_note-test123-2"><a href="#cite_ref-test123_2-0" title="">↑</a> Three</li></ol>
|
<li id="cite_note-test123-2"><a href="#cite_ref-test123_2-0">↑</a> Three</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -230,21 +230,21 @@ Erroneous refs
|
||||||
!! result
|
!! result
|
||||||
<p><strong class="error">Cite error: Invalid <code><ref></code> tag;
|
<p><strong class="error">Cite error: Invalid <code><ref></code> tag;
|
||||||
name cannot be a simple integer. Use a descriptive title</strong>
|
name cannot be a simple integer. Use a descriptive title</strong>
|
||||||
</p><p><sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
</p><p><sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
</p><p><strong class="error">Cite error: Invalid <code><ref></code> tag;
|
</p><p><strong class="error">Cite error: Invalid <code><ref></code> tag;
|
||||||
refs with no content must have a name</strong>
|
refs with no content must have a name</strong>
|
||||||
</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-bar_1-0" class="reference"><a href="#cite_note-bar-1">[2]</a></sup>
|
||||||
</p><p><sup id="cite_ref-blankwithnoreference_2-0" class="reference"><a href="#cite_note-blankwithnoreference-2" title="">[3]</a></sup>
|
</p><p><sup id="cite_ref-blankwithnoreference_2-0" class="reference"><a href="#cite_note-blankwithnoreference-2">[3]</a></sup>
|
||||||
</p><p><strong class="error">Cite error: Invalid <code><references></code> tag;
|
</p><p><strong class="error">Cite error: Invalid <code><references></code> tag;
|
||||||
no input is allowed. Use <code><references /></code></strong>
|
no input is allowed. Use <code><references /></code></strong>
|
||||||
</p><p><strong class="error">Cite error: Invalid <code><references></code> tag;
|
</p><p><strong class="error">Cite error: Invalid <code><references></code> tag;
|
||||||
parameter "group" is allowed only.
|
parameter "group" is allowed only.
|
||||||
Use <code><references /></code>, or <code><references group="…" /></code></strong>
|
Use <code><references /></code>, or <code><references group="…" /></code></strong>
|
||||||
</p>
|
</p>
|
||||||
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> Also zero, but differently! (Normal ref)</li>
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0">↑</a> Also zero, but differently! (Normal ref)</li>
|
||||||
<li id="cite_note-bar"><a href="#cite_ref-bar_0" title="">↑</a> <strong class="error">Cite error: Invalid <code><ref></code> tag;
|
<li id="cite_note-bar"><a href="#cite_ref-bar_0">↑</a> <strong class="error">Cite error: Invalid <code><ref></code> tag;
|
||||||
no text was provided for refs named <code>bar</code></strong></li>
|
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;
|
<li id="cite_note-blankwithnoreference"><a href="#cite_ref-blankwithnoreference_0">↑</a> <strong class="error">Cite error: Invalid <code><ref></code> tag;
|
||||||
no text was provided for refs named <code>blankwithnoreference</code></strong></li></ol>
|
no text was provided for refs named <code>blankwithnoreference</code></strong></li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
@ -259,11 +259,11 @@ Wikipedia rocks!<ref group=note>Proceeds of Rockology, vol. XXI</ref>
|
||||||
<references/>
|
<references/>
|
||||||
<references group=note/>
|
<references group=note/>
|
||||||
!! result
|
!! result
|
||||||
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[1]</a></sup>
|
<p>Wikipedia rocks!<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[1]</a></sup>
|
||||||
Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1" title="">[note 1]</a></sup>
|
Wikipedia rocks!<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[note 1]</a></sup>
|
||||||
</p>
|
</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-0"><a href="#cite_ref-0">↑</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>
|
<ol class="references"><li id="cite_note-1"><a href="#cite_ref-1">↑</a> Proceeds of Rockology, vol. XXI</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
||||||
|
@ -277,14 +277,14 @@ AAA<ref group="参">ref a</ref>BBB<ref group="注">note b</ref>CCC<ref group="
|
||||||
;notes
|
;notes
|
||||||
<references group="注" />
|
<references group="注" />
|
||||||
!! result
|
!! result
|
||||||
<p>AAA<sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title="">[参 1]</a></sup>BBB<sup id="cite_ref-1" class="reference"><a href="#cite_note-1" title="">[注 1]</a></sup>CCC<sup id="cite_ref-2" class="reference"><a href="#cite_note-2" title="">[参 2]</a></sup>
|
<p>AAA<sup id="cite_ref-0" class="reference"><a href="#cite_note-0">[参 1]</a></sup>BBB<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[注 1]</a></sup>CCC<sup id="cite_ref-2" class="reference"><a href="#cite_note-2">[参 2]</a></sup>
|
||||||
</p>
|
</p>
|
||||||
<dl><dt>refs
|
<dl><dt>refs
|
||||||
</dt></dl>
|
</dt></dl>
|
||||||
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0" title="">↑</a> ref a</li>
|
<ol class="references"><li id="cite_note-0"><a href="#cite_ref-0">↑</a> ref a</li>
|
||||||
<li id="cite_note-2"><a href="#cite_ref-2" title="">↑</a> ref c</li></ol>
|
<li id="cite_note-2"><a href="#cite_ref-2">↑</a> ref c</li></ol>
|
||||||
<dl><dt>notes
|
<dl><dt>notes
|
||||||
</dt></dl>
|
</dt></dl>
|
||||||
<ol class="references"><li id="cite_note-1"><a href="#cite_ref-1" title="">↑</a> note b</li></ol>
|
<ol class="references"><li id="cite_note-1"><a href="#cite_ref-1">↑</a> note b</li></ol>
|
||||||
|
|
||||||
!! end
|
!! end
|
||||||
|
|
Loading…
Reference in a new issue