Merge "Add parameters to Cite error messages in Parsoid"

This commit is contained in:
jenkins-bot 2024-08-27 11:51:56 +00:00 committed by Gerrit Code Review
commit 6e6a7ebf2a
2 changed files with 22 additions and 19 deletions

View file

@ -308,7 +308,7 @@ class References extends ExtensionTagHandler {
// gets the error "cite_error_references_no_key" above, so protect against that.
if ( $refsData->inReferencesContent() ) {
$errs[] = [ 'key' => 'cite_error_empty_references_define',
'params' => [ $refDmw->attrs->name ?? '' ] ];
'params' => [ $refDmw->attrs->name ?? '', $refDmw->attrs->group ?? '' ] ];
} elseif ( !$hasRefName ) {
if ( !empty( $cDp->selfClose ) ) {
$errs[] = [ 'key' => 'cite_error_ref_no_key' ];
@ -489,7 +489,10 @@ class References extends ExtensionTagHandler {
if ( ( $ref->name !== '' ) && $ref->contentId === null ) {
// TODO: Since this error is being placed on the ref,
// the key should arguably be "cite_error_ref_no_text"
$errs[] = [ 'key' => 'cite_error_references_no_text' ];
$errs[] = [
'key' => 'cite_error_references_no_text',
'params' => [ $ref->name ]
];
}
if ( $errs ) {
foreach ( $ref->nodes as $node ) {

View file

@ -511,9 +511,9 @@ Erroneous refs
<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>
<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"}]}'><a href="./Parser_test#cite_note-bar-4" style="counter-reset: mw-Ref 4;"><span class="mw-reflink-text">[4]</span></a></sup></p>
<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>
<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"}]}'><a href="./Parser_test#cite_note-blankwithnoreference-5" style="counter-reset: mw-Ref 5;"><span class="mw-reflink-text">[5]</span></a></sup></p>
<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>
<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>
@ -963,9 +963,9 @@ T242437 - Nested references edge case, inner tag function with LDR
<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code>&lt;ref&gt;</code> tag defined in <code>&lt;references&gt;</code> has no name attribute.</span>
</p>
!! html/parsoid
<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"}]}'><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>
<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>
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{"group":"2"},"body":{"html":"\n&lt;sup about=\"#mwt9\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"foo\"]},{\"key\":\"cite_error_references_no_text\"}]}&apos;>&lt;a href=\"./Parser_test#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"2\">&lt;span class=\"mw-reflink-text\">[2 1]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt10\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"unused\"},\"body\":{\"id\":\"mw-reference-text-cite_note-unused-2\"},\"errors\":[{\"key\":\"cite_error_references_missing_key\",\"params\":[\"unused\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-unused-2\" style=\"counter-reset: mw-Ref 2;\" data-mw-group=\"2\">&lt;span class=\"mw-reflink-text\">[2 2]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt11\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"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\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-foo-3\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"1\">&lt;span class=\"mw-reflink-text\">[1 1]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt12\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"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\"]},{\"key\":\"cite_error_group_refs_without_references\",\"params\":[\"1\"]},{\"key\":\"cite_error_references_no_text\"}]}&apos;>&lt;a href=\"./Parser_test#cite_note-bar-4\" style=\"counter-reset: mw-Ref 2;\" data-mw-group=\"1\">&lt;span class=\"mw-reflink-text\">[1 2]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt13\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"name\":\"ref\",\"attrs\":{},\"body\":{\"id\":\"mw-reference-text-cite_note-5\"},\"errors\":[{\"key\":\"cite_error_references_no_key\"}]}&apos;>&lt;a href=\"./Parser_test#cite_note-5\" style=\"counter-reset: mw-Ref 3;\" data-mw-group=\"2\">&lt;span class=\"mw-reflink-text\">[2 3]&lt;/span>&lt;/a>&lt;/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>
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{"group":"2"},"body":{"html":"\n&lt;sup about=\"#mwt9\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"foo\",\"\"]},{\"key\":\"cite_error_references_no_text\",\"params\":[\"foo\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-foo-1\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"2\">&lt;span class=\"mw-reflink-text\">[2 1]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt10\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"unused\"},\"body\":{\"id\":\"mw-reference-text-cite_note-unused-2\"},\"errors\":[{\"key\":\"cite_error_references_missing_key\",\"params\":[\"unused\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-unused-2\" style=\"counter-reset: mw-Ref 2;\" data-mw-group=\"2\">&lt;span class=\"mw-reflink-text\">[2 2]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt11\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"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\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-foo-3\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"1\">&lt;span class=\"mw-reflink-text\">[1 1]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt12\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"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\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-bar-4\" style=\"counter-reset: mw-Ref 2;\" data-mw-group=\"1\">&lt;span class=\"mw-reflink-text\">[1 2]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt13\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"name\":\"ref\",\"attrs\":{},\"body\":{\"id\":\"mw-reference-text-cite_note-5\"},\"errors\":[{\"key\":\"cite_error_references_no_key\"}]}&apos;>&lt;a href=\"./Parser_test#cite_note-5\" style=\"counter-reset: mw-Ref 3;\" data-mw-group=\"2\">&lt;span class=\"mw-reflink-text\">[2 3]&lt;/span>&lt;/a>&lt;/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>
<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>
!! end
@ -978,9 +978,9 @@ TWO<ref group="NOTES" name="foo" />
THREE<ref group="NOTES" name="bar">CONTENT</ref>
<references group="NOTES" />
!! html/parsoid
<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"}]}'><a href="./Parser_test#cite_note-foo-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
<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>
<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>
<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"}]}'><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>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>
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>
<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>
!! html/php
@ -1027,9 +1027,9 @@ Error conditions on non-visible content
</p>
!! html/parsoid
<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>
<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"}]}'><a href="./Parser_test#cite_note-b-2" style="counter-reset: mw-Ref 2;"><span class="mw-reflink-text">[2]</span></a></sup>
<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"}]}'><a href="./Parser_test#cite_note-c-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p>
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{},"body":{"html":"\n&lt;sup about=\"#mwt11\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid=&apos;{\"dsr\":[74,90,16,0]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"a\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"a\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\">&lt;span class=\"mw-reflink-text\">[1]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt12\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid=&apos;{\"dsr\":[91,107,16,0]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"b\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"b\"]},{\"key\":\"cite_error_references_no_text\"}]}&apos;>&lt;a href=\"./Parser_test#cite_note-b-2\" style=\"counter-reset: mw-Ref 2;\">&lt;span class=\"mw-reflink-text\">[2]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt13\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid=&apos;{\"dsr\":[108,129,14,6]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"c\"},\"body\":{\"html\":\" \"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"c\"]},{\"key\":\"cite_error_references_no_text\"}]}&apos;>&lt;a href=\"./Parser_test#cite_note-c-3\" style=\"counter-reset: mw-Ref 3;\">&lt;span class=\"mw-reflink-text\">[3]&lt;/span>&lt;/a>&lt;/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>
<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>
<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>
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{},"body":{"html":"\n&lt;sup about=\"#mwt11\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid=&apos;{\"dsr\":[74,90,16,0]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"a\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"a\",\"\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-a-1\" style=\"counter-reset: mw-Ref 1;\">&lt;span class=\"mw-reflink-text\">[1]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt12\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid=&apos;{\"dsr\":[91,107,16,0]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"b\"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"b\",\"\"]},{\"key\":\"cite_error_references_no_text\",\"params\":[\"b\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-b-2\" style=\"counter-reset: mw-Ref 2;\">&lt;span class=\"mw-reflink-text\">[2]&lt;/span>&lt;/a>&lt;/sup>\n&lt;sup about=\"#mwt13\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid=&apos;{\"dsr\":[108,129,14,6]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"c\"},\"body\":{\"html\":\" \"},\"errors\":[{\"key\":\"cite_error_empty_references_define\",\"params\":[\"c\",\"\"]},{\"key\":\"cite_error_references_no_text\",\"params\":[\"c\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-c-3\" style=\"counter-reset: mw-Ref 3;\">&lt;span class=\"mw-reflink-text\">[3]&lt;/span>&lt;/a>&lt;/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>
!! end
# This article is used in the '<ref> with custom group link' test below
@ -1194,7 +1194,7 @@ Bla.<ref name="void"> </ref>
<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>&lt;ref&gt;</code> tag; no text was provided for refs named <code>void</code></span></li>
</ol></div>
!! html/parsoid
<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"}]}'><a href="./Parser_test#cite_note-void-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
<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>
<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>
!! end
@ -1424,7 +1424,7 @@ C <ref name="y" />
!! html/parsoid
<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>
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>
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"}]}'><a href="./Parser_test#cite_note-y-3" style="counter-reset: mw-Ref 3;"><span class="mw-reflink-text">[3]</span></a></sup></p>
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>
<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>
!! end
@ -2024,20 +2024,20 @@ NINE<ref group="NOTES" name="bar">NINECONTENT</ref>
TEN<ref group="NOTES" name="foo">TENCONTENT</ref>
<references group="NOTES" />
!! html/parsoid
<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"}]}'><a href="./Parser_test#cite_note-foo-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
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"}]}'><a href="./Parser_test#cite_note-foo-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup>
<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>
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>
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>
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>
<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>
<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>
<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>
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"}]}'><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>
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"}]}'><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>
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>
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>
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>
<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>
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt39" data-mw='{"name":"references","attrs":{},"body":{"html":"\n&lt;sup about=\"#mwt37\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid=&apos;{\"dsr\":[398,434,16,6]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"foo\"},\"body\":{\"id\":\"mw-reference-text-cite_note-foo-5\"}}&apos;>&lt;a href=\"./Parser_test#cite_note-foo-5\" style=\"counter-reset: mw-Ref 1;\" data-parsoid=\"{}\">&lt;span class=\"mw-reflink-text\" data-parsoid=\"{}\">[1]&lt;/span>&lt;/a>&lt;/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>
<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"}]}'><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>
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"}]}'><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>
<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>
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>
<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>
<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>
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>