Merge "Add test cases for duplicate <references> with same group"

This commit is contained in:
jenkins-bot 2019-12-02 15:26:02 +00:00 committed by Gerrit Code Review
commit 79e7b2b474

View file

@ -1276,6 +1276,19 @@ A <ref>foo</ref>
B <ref>bar</ref>
<references />
!! html
<p>A <sup id="cite_ref-1" class="reference"><a href="#cite_note-1">&#91;1&#93;</a></sup>
</p>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">foo</span>
</li>
</ol></div>
<p>B <sup id="cite_ref-2" class="reference"><a href="#cite_note-2">&#91;1&#93;</a></sup>
</p>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">bar</span>
</li>
</ol></div>
!! html/parsoid
<p>A <sup about="#mwt2" class="mw-ref" 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"><span class="mw-reflink-text">[1]</span></a></sup></p>
@ -1289,6 +1302,31 @@ B <ref>bar</ref>
</ol>
!! end
!! test
Counters should be cleared after processing named <references group="…">
!! wikitext
A <ref group="g">foo</ref>
<references group="g" />
B <ref group="g">bar</ref>
<references group="g" />
!! html
<p>A <sup id="cite_ref-1" class="reference"><a href="#cite_note-1">&#91;g 1&#93;</a></sup>
</p>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text">foo</span>
</li>
</ol></div>
<p>B <sup id="cite_ref-2" class="reference"><a href="#cite_note-2">&#91;g 1&#93;</a></sup>
</p>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text">bar</span>
</li>
</ol></div>
!! end
!! test
References: 4. only referenced group should be cleared after processing references
!! wikitext