Display Cite error messages in Parsoid

Bug: T372709
Depends-On: Ieed7b5a18f5223c7b8a2918df88790d4dc305f9d
Change-Id: Ifeb3b216e898bec1c3eb5917262820c5809fda45
This commit is contained in:
Isabelle Hurbain-Palatin 2024-10-28 18:44:08 +01:00
parent 3de7bf6a2a
commit dd6587c426
7 changed files with 198 additions and 48 deletions

View file

@ -2,6 +2,7 @@
namespace Cite; namespace Cite;
use Cite\Parsoid\ErrorUtils;
use InvalidArgumentException; use InvalidArgumentException;
use MediaWiki\Html\Html; use MediaWiki\Html\Html;
use MediaWiki\Language\Language; use MediaWiki\Language\Language;
@ -75,6 +76,9 @@ class ErrorReporter {
if ( $type === 'error' ) { if ( $type === 'error' ) {
// Take care; this is a sideeffect that might not belong to this class. // Take care; this is a sideeffect that might not belong to this class.
$parser->addTrackingCategory( 'cite-tracking-category-cite-error' ); $parser->addTrackingCategory( 'cite-tracking-category-cite-error' );
if ( ErrorUtils::isDiffingError( $key ) ) {
$parser->addTrackingCategory( 'cite-tracking-category-cite-diffing-error' );
}
} }
// Optional wrapper messages: cite_error, cite_warning // Optional wrapper messages: cite_error, cite_warning
@ -125,5 +129,4 @@ class ErrorReporter {
} }
return array_slice( $matches, 1 ); return array_slice( $matches, 1 );
} }
} }

View file

@ -0,0 +1,61 @@
<?php
declare( strict_types = 1 );
namespace Cite\Parsoid;
use Wikimedia\Message\MessageValue;
use Wikimedia\Parsoid\DOM\DocumentFragment;
use Wikimedia\Parsoid\Ext\DOMUtils;
use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI;
use Wikimedia\Parsoid\Utils\DOMCompat;
/**
* @license GPL-2.0-or-later
*/
class ErrorUtils {
/**
* This method compares the provided $catName against the Cite error message keys where there are known,
* expected differences in the rendering (typically: Parsoid renders errors at the bottom of the page rather
* than inline). It does not take into account categories where there are known, but unexpected/undesired
* differences (typically: one parser renders an error and the other does not).
*/
public static function isDiffingError( string $catName ): bool {
static $diffingErrors = [
'cite_error_ref_numeric_key' => true,
'cite_error_ref_no_key' => true,
'cite_error_ref_too_many_keys' => true,
'cite_error_references_invalid_parameters' => true,
'cite_error_ref_invalid_dir' => true,
'cite_error_ref_follow_conflicts' => true,
'cite_error_ref_no_input' => true,
'cite_error_group_refs_without_references' => true,
];
return $diffingErrors[$catName] ?? false;
}
/**
* Creates a document fragment containing the Parsoid rendering of an error message
*/
public static function renderParsoidError(
ParsoidExtensionAPI $extApi,
string $errorKey,
?array $errorParams
): DocumentFragment {
$error = new MessageValue( $errorKey, $errorParams ?? [] );
return self::renderParsoidErrorSpan( $extApi, $error );
}
/**
* Adds classes and lead on an existing Parsoid rendering of an error message, sets the tracking category and
* returns the completed fragment
*/
public static function renderParsoidErrorSpan(
ParsoidExtensionAPI $extApi, MessageValue $error
): DocumentFragment {
$extApi->addTrackingCategory( 'cite-tracking-category-cite-error' );
$fragment = $extApi->createInterfaceI18nFragment( 'cite_error', [ $error ] );
$fragSpan = DOMCompat::getLastElementChild( $fragment );
DOMUtils::addAttributes( $fragSpan, [ 'class' => 'error mw-ext-cite-error' ] );
return $fragment;
}
}

View file

@ -5,6 +5,7 @@ namespace Cite\Parsoid;
use Wikimedia\Parsoid\DOM\Document; use Wikimedia\Parsoid\DOM\Document;
use Wikimedia\Parsoid\DOM\Element; use Wikimedia\Parsoid\DOM\Element;
use Wikimedia\Parsoid\Ext\DOMDataUtils;
use Wikimedia\Parsoid\Ext\DOMUtils; use Wikimedia\Parsoid\Ext\DOMUtils;
use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI; use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI;
use Wikimedia\Parsoid\Utils\DOMCompat; use Wikimedia\Parsoid\Utils\DOMCompat;
@ -83,6 +84,16 @@ class RefGroup {
} }
$li->appendChild( $reftextSpan ); $li->appendChild( $reftextSpan );
foreach ( $ref->nodes as $node ) {
foreach ( DOMDataUtils::getDataMw( $node )->errors ?? [] as $error ) {
$errorFragment = ErrorUtils::renderParsoidError( $extApi, $error->key, $error->params );
$li->appendChild( $errorFragment );
if ( ErrorUtils::isDiffingError( $error->key ) ) {
$extApi->addTrackingCategory( 'cite-tracking-category-cite-diffing-error' );
}
}
}
// mw:referencedBy is added to the <span> for the named refs case // mw:referencedBy is added to the <span> for the named refs case
// and to the <a> tag to the unnamed refs case. This difference // and to the <a> tag to the unnamed refs case. This difference
// is used by CSS to style backlinks in MediaWiki:Common.css // is used by CSS to style backlinks in MediaWiki:Common.css

View file

@ -6,11 +6,13 @@ declare( strict_types = 1 );
namespace Cite\Parsoid; namespace Cite\Parsoid;
use Cite\Cite;
use Cite\MarkSymbolRenderer; use Cite\MarkSymbolRenderer;
use Closure; use Closure;
use MediaWiki\Config\Config; use MediaWiki\Config\Config;
use MediaWiki\MediaWikiServices; use MediaWiki\MediaWikiServices;
use stdClass; use stdClass;
use Wikimedia\Message\MessageValue;
use Wikimedia\Parsoid\Core\DomSourceRange; use Wikimedia\Parsoid\Core\DomSourceRange;
use Wikimedia\Parsoid\DOM\DocumentFragment; use Wikimedia\Parsoid\DOM\DocumentFragment;
use Wikimedia\Parsoid\DOM\Element; use Wikimedia\Parsoid\DOM\Element;
@ -158,6 +160,18 @@ class References extends ExtensionTagHandler {
); );
} }
static $validAttributes = [
'group' => true,
'name' => true,
Cite::SUBREF_ATTRIBUTE => true,
'follow' => true,
'dir' => true
];
if ( array_diff_key( (array)$refDmw->attrs, $validAttributes ) !== [] ) {
$errs[] = new DataMwError( 'cite_error_ref_too_many_keys' );
}
// NOTE: This will have been trimmed in Utils::getExtArgInfo()'s call // NOTE: This will have been trimmed in Utils::getExtArgInfo()'s call
// to TokenUtils::kvToHash() and ExtensionHandler::normalizeExtOptions() // to TokenUtils::kvToHash() and ExtensionHandler::normalizeExtOptions()
$refName = $refDmw->attrs->name ?? ''; $refName = $refDmw->attrs->name ?? '';
@ -764,6 +778,7 @@ class References extends ExtensionTagHandler {
foreach ( $refsOpts as $key => $value ) { foreach ( $refsOpts as $key => $value ) {
if ( !in_array( strtolower( (string)$key ), $knownAttributes, true ) ) { if ( !in_array( strtolower( (string)$key ), $knownAttributes, true ) ) {
$extApi->pushError( 'cite_error_references_invalid_parameters' ); $extApi->pushError( 'cite_error_references_invalid_parameters' );
$error = new MessageValue( 'cite_error_references_invalid_parameters' );
break; break;
} }
} }
@ -782,6 +797,14 @@ class References extends ExtensionTagHandler {
} }
); );
$domFragment->appendChild( $frag ); $domFragment->appendChild( $frag );
if ( isset( $error ) ) {
$errorFragment = ErrorUtils::renderParsoidErrorSpan( $extApi, $error );
// we're pushing it after the reference block while it tends to be before in legacy (error + rerender)
$extApi->addTrackingCategory( 'cite-tracking-category-cite-diffing-error' );
$frag->appendChild( $errorFragment );
}
return $domFragment; return $domFragment;
} }

View file

@ -73,7 +73,7 @@
}, },
"Erroneous refs": { "Erroneous refs": {
"wt2wt": "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n<ref name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n\n<references />", "wt2wt": "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n<ref name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n\n<references />",
"html2wt": "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n<ref name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n\n<references />", "html2wt": "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n<ref name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n<references />",
"selser [0,0,4,2,4,0,0,3,0,0,0,0,0]": "<ref name=\"0\">Zero</ref>\n\nwie687\n\n1u7xv04\n\n1pm36tv\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n\n<references />", "selser [0,0,4,2,4,0,0,3,0,0,0,0,0]": "<ref name=\"0\">Zero</ref>\n\nwie687\n\n1u7xv04\n\n1pm36tv\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />\n\n<references />",
"selser [3,2,0,0,1,2,0,0,1,0,0,2,0]": "1tb8tca\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\nl49cv6\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />ql4aqu\n\n<references />", "selser [3,2,0,0,1,2,0,0,1,0,0,2,0]": "1tb8tca\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\nl49cv6\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" />ql4aqu\n\n<references />",
"selser [0,3,0,0,0,2,0,0,1,0,0,3,0]": "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n1if3p11\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" /><references />", "selser [0,3,0,0,0,2,0,0,1,0,0,3,0]": "<ref name=\"0\">Zero</ref>\n\n<ref>Also zero, but differently! (Normal ref)</ref>\n\n<ref />\n\n1if3p11\n\n<ref name=\"foo\" name=\"bar\" />\n\n<ref name=\"blankwithnoreference\" />\n\n<references name=\"quasit\" /><references />",
@ -244,8 +244,8 @@
}, },
"References: 9. Generate missing references list at the end": { "References: 9. Generate missing references list at the end": {
"wt2wt": "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>\n<references />\n", "wt2wt": "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>\n<references />\n",
"html2html": "<p data-parsoid='{\"dsr\":[0,52,0,0]}'>A <sup about=\"#mwt\" class=\"mw-ref reference\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[2,16,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> B <sup about=\"#mwt\" class=\"mw-ref reference\" id=\"cite_ref-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid='{\"dsr\":[19,52,24,6]}' 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\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[inexistent 1]</span></a></sup></p>\n<div class=\"mw-references-wrap\" typeof=\"mw:Extension/references\" about=\"#mwt\" data-parsoid='{\"dsr\":[53,67,14,0]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><ol class=\"mw-references references\" data-parsoid=\"{}\"><li about=\"#cite_note-1\" id=\"cite_note-1\" data-parsoid=\"{}\"><span class=\"mw-cite-backlink\" data-parsoid=\"{}\"><a href=\"./Parser_test#cite_ref-1\" rel=\"mw:referencedBy\" data-parsoid=\"{}\"><span class=\"mw-linkback-text\" data-parsoid=\"{}\">↑ </span></a></span> <span id=\"mw-reference-text-cite_note-1\" class=\"mw-reference-text reference-text\" data-parsoid=\"{}\">foo</span></li>\n</ol></div>\n\n<div class=\"mw-references-wrap\" typeof=\"mw:Extension/references\" about=\"#mwt\" data-parsoid='{\"group\":\"inexistent\",\"dsr\":[68,68,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"inexistent\"},\"autoGenerated\":true}'><ol class=\"mw-references references\" data-mw-group=\"inexistent\" data-parsoid=\"{}\"><li about=\"#cite_note-2\" id=\"cite_note-2\" data-parsoid=\"{}\"><span class=\"mw-cite-backlink\" data-parsoid=\"{}\"><a href=\"./Parser_test#cite_ref-2\" data-mw-group=\"inexistent\" rel=\"mw:referencedBy\" data-parsoid=\"{}\"><span class=\"mw-linkback-text\" data-parsoid=\"{}\">↑ </span></a></span> <span id=\"mw-reference-text-cite_note-2\" class=\"mw-reference-text reference-text\" data-parsoid=\"{}\">bar</span></li>\n</ol></div>",
"html2wt": "A <ref>foo</ref> B <ref group=\"inexistent\">bar</ref>\n<references />\n", "html2wt": "A <ref>foo</ref> B <ref group=\"inexistent\">bar</ref>\n<references />\n",
"html2html": "<p data-parsoid='{\"dsr\":[0,52,0,0]}'>A <sup about=\"#mwt\" class=\"mw-ref reference\" id=\"cite_ref-1\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[2,16,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> B <sup about=\"#mwt\" class=\"mw-ref reference\" id=\"cite_ref-2\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-parsoid='{\"dsr\":[19,52,24,6]}' 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\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[inexistent 1]</span></a></sup></p>\n<div class=\"mw-references-wrap\" typeof=\"mw:Extension/references\" about=\"#mwt\" data-parsoid='{\"dsr\":[53,67,14,0]}' data-mw='{\"name\":\"references\",\"attrs\":{}}'><ol class=\"mw-references references\" data-parsoid=\"{}\"><li about=\"#cite_note-1\" id=\"cite_note-1\" data-parsoid=\"{}\"><span class=\"mw-cite-backlink\" data-parsoid=\"{}\"><a href=\"./Parser_test#cite_ref-1\" rel=\"mw:referencedBy\" data-parsoid=\"{}\"><span class=\"mw-linkback-text\" data-parsoid=\"{}\">↑ </span></a></span> <span id=\"mw-reference-text-cite_note-1\" class=\"mw-reference-text reference-text\" data-parsoid=\"{}\">foo</span></li>\n</ol></div>\n\n<div class=\"mw-references-wrap\" typeof=\"mw:Extension/references\" about=\"#mwt\" data-parsoid='{\"group\":\"inexistent\",\"dsr\":[68,68,0,0]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"inexistent\"},\"autoGenerated\":true}'><ol class=\"mw-references references\" data-mw-group=\"inexistent\" data-parsoid=\"{}\"><li about=\"#cite_note-2\" id=\"cite_note-2\" data-parsoid=\"{}\"><span class=\"mw-cite-backlink\" data-parsoid=\"{}\"><a href=\"./Parser_test#cite_ref-2\" data-mw-group=\"inexistent\" rel=\"mw:referencedBy\" data-parsoid=\"{}\"><span class=\"mw-linkback-text\" data-parsoid=\"{}\">↑ </span></a></span> <span id=\"mw-reference-text-cite_note-2\" class=\"mw-reference-text reference-text\" data-parsoid=\"{}\">bar</span><span typeof=\"mw:I18n\" class=\"error mw-ext-cite-error\" data-parsoid=\"{}\" data-mw-i18n='{\"/\":{\"lang\":\"x-user\",\"key\":\"cite_error\",\"params\":{\"0\":{\"key\":\"cite_error_group_refs_without_references\",\"params\":{\"0\":{\"text\":\"inexistent\",\"_type_\":\"Wikimedia\\\\Message\\\\ScalarParam\"},\"_type_\":\"array\"},\"_type_\":\"Wikimedia\\\\Message\\\\MessageValue\"},\"_type_\":\"array\"}}}'></span></li>\n</ol></div>",
"selser [0,4,0,3,0]": "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>\n\ng0czw3", "selser [0,4,0,3,0]": "A <ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>\n\ng0czw3",
"selser [4,4,0,4,0]": "whc1pl\n\n1mmf2281nhjc7y", "selser [4,4,0,4,0]": "whc1pl\n\n1mmf2281nhjc7y",
"selser [[2,0,2,0],0,0,3,0]": "1cd0gbiA <ref>foo</ref>117zkke\nB <ref group=\"inexistent\">bar</ref>\n", "selser [[2,0,2,0],0,0,3,0]": "1cd0gbiA <ref>foo</ref>117zkke\nB <ref group=\"inexistent\">bar</ref>\n",
@ -267,10 +267,6 @@
"selser [[4,0,0,0],3,0,3,0]": "8kgceb<ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>", "selser [[4,0,0,0],3,0,3,0]": "8kgceb<ref>foo</ref>\nB <ref group=\"inexistent\">bar</ref>",
"selser [3,0,0,0,0]": "\n" "selser [3,0,0,0,0]": "\n"
}, },
"Report bad attributes in ref tags": {
"wt2html": "<p data-parsoid='{\"dsr\":[0,65,0,0]}'><sup about=\"#mwt\" class=\"mw-ref reference\" id=\"cite_ref-theName_1-0\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[0,65,51,6]}' data-mw='{\"name\":\"ref\",\"attrs\":{\"name\":\"theName\",\"group\":\"theGroup\",\"dummy\":\"dummy\"},\"body\":{\"id\":\"mw-reference-text-cite_note-theName-1\"}}'><a href=\"./Parser_test#cite_note-theName-1\" style=\"counter-reset: mw-Ref 1;\" data-mw-group=\"theGroup\" data-parsoid=\"{}\"><span class=\"mw-reflink-text\" data-parsoid=\"{}\">[theGroup 1]</span></a></sup></p>\n<div class=\"mw-references-wrap\" typeof=\"mw:Extension/references\" about=\"#mwt\" data-parsoid='{\"group\":\"theGroup\",\"dsr\":[66,97,31,0]}' data-mw='{\"name\":\"references\",\"attrs\":{\"group\":\"theGroup\"}}'><ol class=\"mw-references references\" data-mw-group=\"theGroup\" data-parsoid=\"{}\"><li about=\"#cite_note-theName-1\" id=\"cite_note-theName-1\" data-parsoid=\"{}\"><span class=\"mw-cite-backlink\" data-parsoid=\"{}\"><a href=\"./Parser_test#cite_ref-theName_1-0\" data-mw-group=\"theGroup\" rel=\"mw:referencedBy\" data-parsoid=\"{}\"><span class=\"mw-linkback-text\" data-parsoid=\"{}\">↑ </span></a></span> <span id=\"mw-reference-text-cite_note-theName-1\" class=\"mw-reference-text reference-text\" data-parsoid=\"{}\">theValue</span></li>\n</ol></div>",
"html2wt": "<span class=\"error mw-ext-cite-error\" lang=\"en\" dir=\"ltr\">Cite error: Invalid parameter in <code><nowiki><ref></nowiki></code> tag</span>\n"
},
"Simple <ref>, with <references/> in group, with groupname in Chinese": { "Simple <ref>, with <references/> in group, with groupname in Chinese": {
"html2wt": "AAA<ref group=\"参\">ref a</ref>BBB<ref group=\"注\">note b</ref>CCC<ref group=\"参\">ref c</ref>\n\n; refs\n<references group=\"参\" />\n\n; notes\n<references group=\"注\" />" "html2wt": "AAA<ref group=\"参\">ref a</ref>BBB<ref group=\"注\">note b</ref>CCC<ref group=\"参\">ref c</ref>\n\n; refs\n<references group=\"参\" />\n\n; notes\n<references group=\"注\" />"
}, },

View file

@ -394,7 +394,7 @@ Regression: non-blank ref "0" followed by ref with content
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_duplicate_key","params":{"0":{"text":"blank","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -418,7 +418,7 @@ Regression sanity check: non-blank ref "1" followed by ref with content
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_duplicate_key","params":{"0":{"text":"blank","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -476,6 +476,11 @@ T184912: Consistent normalization of consecutive underscores
!! test !! test
Erroneous refs Erroneous refs
!! options
cat
!! metadata
cat=Pages_with_reference_errors sort=
cat=Pages_with_reference_errors_that_trigger_visual_diffs sort=
!! wikitext !! wikitext
<ref name="0">Zero</ref> <ref name="0">Zero</ref>
@ -515,8 +520,8 @@ Erroneous refs
<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> <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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_numeric_key","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_no_key","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"bar","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"blankwithnoreference","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol>
<span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_invalid_parameters","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></div>
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div> <div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt14" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references"></ol></div>
!! end !! end
@ -530,7 +535,7 @@ Can't have name="…" and follow="…" the same time
</p> </p>
!! html/parsoid !! html/parsoid
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_follow_conflicts","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -542,8 +547,8 @@ Conflicting name="…" and follow="…" together with another invalid parameter
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code>&lt;ref&gt;</code> tag</span> <p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code>&lt;ref&gt;</code> tag</span>
</p> </p>
!! html/parsoid !! html/parsoid
<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> <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_too_many_keys"},{"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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_too_many_keys","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_follow_conflicts","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -562,7 +567,7 @@ It's not possible to follow="…" a <ref> defined in the <references> section
</p> </p>
!! html/parsoid !! html/parsoid
<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> <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>
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{},"body":{"html":"\n&lt;sup about=\"#mwt5\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"theName\"},\"body\":{\"id\":\"mw-reference-text-cite_note-theName-2\"},\"errors\":[{\"key\":\"cite_error_references_missing_key\",\"params\":[\"theName\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-theName-2\" style=\"counter-reset: mw-Ref 2;\">&lt;span class=\"mw-reflink-text\">[2]&lt;/span>&lt;/a>&lt;/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> <div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{},"body":{"html":"\n&lt;sup about=\"#mwt5\" class=\"mw-ref reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref mw:Error\" data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"theName\"},\"body\":{\"id\":\"mw-reference-text-cite_note-theName-2\"},\"errors\":[{\"key\":\"cite_error_references_missing_key\",\"params\":[\"theName\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-theName-2\" style=\"counter-reset: mw-Ref 2;\">&lt;span class=\"mw-reflink-text\">[2]&lt;/span>&lt;/a>&lt;/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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_missing_key","params":{"0":{"text":"theName","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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>
!! end !! end
## Note that the Cite extension of the legacy parser is putting paragraphs ## Note that the Cite extension of the legacy parser is putting paragraphs
@ -586,7 +591,7 @@ A follow="…" before its parent is not merged
!! html/parsoid !! html/parsoid
<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><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>
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_missing_key","params":{"0":{"text":"theName","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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>
!! end !! end
## This is a nasty edge case which was dropping the ref entirely from the ## This is a nasty edge case which was dropping the ref entirely from the
@ -617,7 +622,7 @@ A follow="…" before its parent is not merged
<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> <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>
<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> <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>
<hr data-parsoid='{"stx":"html","selfClose":true}'/> <hr data-parsoid='{"stx":"html","selfClose":true}'/>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_missing_key","params":{"0":{"text":"third","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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>
!! end !! end
!! test !! test
@ -646,7 +651,7 @@ A follow="…" before its parent is not merged
<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> <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>
<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> <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>
<hr data-parsoid='{"stx":"html","selfClose":true}'/> <hr data-parsoid='{"stx":"html","selfClose":true}'/>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_missing_key","params":{"0":{"text":"third","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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>
!! end !! end
!! test !! test
@ -705,7 +710,7 @@ Follow following a named ref with multiple definitions
<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> <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>
<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> <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>
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_duplicate_key","params":{"0":{"text":"test","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -736,15 +741,22 @@ MOD<sup about="#mwt8" class="mw-ref reference mw-ref-follow" rel="dc:references"
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" 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-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"theName\"},\"body\":{\"html\":\" theValue\"},\"errors\":[{\"key\":\"cite_error_references_duplicate_key\",\"params\":[\"theName\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-theName-1\" style=\"counter-reset: mw-Ref 1;\">&lt;span class=\"mw-reflink-text\">[1]&lt;/span>&lt;/a>&lt;/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> <div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt12" 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-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"theName\"},\"body\":{\"html\":\" theValue\"},\"errors\":[{\"key\":\"cite_error_references_duplicate_key\",\"params\":[\"theName\"]}]}&apos;>&lt;a href=\"./Parser_test#cite_note-theName-1\" style=\"counter-reset: mw-Ref 1;\">&lt;span class=\"mw-reflink-text\">[1]&lt;/span>&lt;/a>&lt;/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>
!!end !!end
# T307741: Parsoid fails this test in both standalone and integrated modes.
!! test !! test
Report bad attributes in ref tags Report bad attributes in ref tags
!! wikitext !! wikitext
<ref name="theName" group="theGroup" dummy="dummy">theValue</ref> <ref name="theName" group="theGroup" dummy="dummy">theValue</ref>
<references group="theGroup" /> <references group="theGroup" />
!! html !! html/php
<p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code>&lt;ref&gt;</code> tag</span> <p><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid parameter in <code>&lt;ref&gt;</code> tag</span>
</p> </p>
!! html/parsoid
<p><sup 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","group":"theGroup","dummy":"dummy"},"body":{"id":"mw-reference-text-cite_note-theName-1"},"errors":[{"key":"cite_error_ref_too_many_keys"}]}'><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></p>
<div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{"group":"theGroup"}}'>
<ol class="mw-references references" data-mw-group="theGroup">
<li 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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_too_many_keys","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li>
</ol>
</div>
</div>
!! end !! end
!! test !! test
@ -965,7 +977,7 @@ T242437 - Nested references edge case, inner tag function with LDR
!! html/parsoid !! 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","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> <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\",\"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="#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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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> <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 !! end
@ -979,10 +991,10 @@ THREE<ref group="NOTES" name="bar">CONTENT</ref>
<references group="NOTES" /> <references group="NOTES" />
!! html/parsoid !! 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","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> <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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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","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> <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> 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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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 !! html/php
<p>ONE<sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">&#91;</span>1<span class="cite-bracket">&#93;</span></a></sup> <p>ONE<sup id="cite_ref-foo_1-0" class="reference"><a href="#cite_note-foo-1"><span class="cite-bracket">&#91;</span>1<span class="cite-bracket">&#93;</span></a></sup>
</p> </p>
@ -1029,7 +1041,7 @@ Error conditions on non-visible content
<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> <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","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="#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> <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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"b","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"c","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
# This article is used in the '<ref> with custom group link' test below # This article is used in the '<ref> with custom group link' test below
@ -1143,7 +1155,7 @@ zero<span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: The op
<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> <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>
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> 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>
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":"&lt;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> 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":"&lt;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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_no_input","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_no_key","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_no_key","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -1156,7 +1168,7 @@ Bla.<ref name=""> </ref>
</p> </p>
!! html/parsoid !! html/parsoid
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_no_input","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -1173,7 +1185,7 @@ Ho <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: The ope
!! html/parsoid !! html/parsoid
<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> <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>
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> 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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_no_input","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_no_key","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -1189,7 +1201,7 @@ Bla.<ref name="void"> </ref>
</ol></div> </ol></div>
!! html/parsoid !! 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","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> <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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"void","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -1229,7 +1241,7 @@ Multiple definition (outside <references/>)
!! html/parsoid !! html/parsoid
<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><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>
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_duplicate_key","params":{"0":{"text":"a","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -1290,7 +1302,7 @@ T202593: Conflicting dir attributes
<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> <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>
<div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'> <div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'>
<ol class="mw-references references"> <ol class="mw-references references">
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_conflicting_dir","params":{"0":{"text":"a","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li>
</ol> </ol>
</div> </div>
!! end !! end
@ -1314,7 +1326,7 @@ T202593: Conflicting dir attributes with the full ref first
<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> <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>
<div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'> <div class="mw-references-wrap" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'>
<ol class="mw-references references"> <ol class="mw-references references">
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_conflicting_dir","params":{"0":{"text":"a","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li>
</ol> </ol>
</div> </div>
!! end !! end
@ -1419,7 +1431,7 @@ C <ref name="y" />
<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>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> 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","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> 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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"y","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -1758,7 +1770,7 @@ C <ref name="foo" />
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> 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>
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> 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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_duplicate_key","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li>
</ol></div> </ol></div>
!! end !! end
@ -1784,7 +1796,7 @@ POST <sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="
<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> <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>
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> 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>
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> 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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_numeric_key","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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>
!! end !! end
!! test !! test
@ -1800,7 +1812,7 @@ Verify invalid use of a numeric character in a ref name and follow
!! html/parsoid !! html/parsoid
<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> <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>
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_numeric_key","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -2023,16 +2035,16 @@ BETA<sup about="#mwt6" class="mw-ref reference" id="cite_ref-foo_1-1" rel="dc:re
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> 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> 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="#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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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> <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","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> 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> 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> 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="#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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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> <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","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> <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> 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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"bar","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"foo","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></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> <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> 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>
<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> <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>
@ -2060,7 +2072,7 @@ B <ref group="inexistent">bar</ref>
<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-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> </ol></div>
<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"> <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">
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_group_refs_without_references","params":{"0":{"text":"inexistent","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li>
</ol></div> </ol></div>
!! end !! end
@ -2187,9 +2199,9 @@ aDifferentNameGROUP3 <sup about="#mwt8" class="mw-ref reference" id="cite_ref-th
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> 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>
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> 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>
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> 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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_duplicate_key","params":{"0":{"text":"theName3","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_group_refs_without_references","params":{"0":{"text":"theGroup","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_group_refs_without_references","params":{"0":{"text":"theGroup","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_group_refs_without_references","params":{"0":{"text":"theGroup2","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_group_refs_without_references","params":{"0":{"text":"theGroup2","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
# Doesn't wt2wt cleanly because we don't encode the &amp; in html2wt direction # Doesn't wt2wt cleanly because we don't encode the &amp; in html2wt direction
@ -2617,7 +2629,7 @@ T15673: <ref> with direction "nonsense" and "" (empty), strip invalid dir attrib
!! html/parsoid !! html/parsoid
<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> <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>
<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> <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>
<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> <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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_invalid_dir","params":{"0":{"text":"nonsense","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></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><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_ref_invalid_dir","params":{"0":{"text":"","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li></ol></div>
!! end !! end
!! test !! test
@ -2982,11 +2994,14 @@ Report bad attributes in reference tags
</ol></div><p><br /><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code>&lt;ref&gt;</code> tags exist for a group named "theGroup", but no corresponding <code>&lt;references group="theGroup"/&gt;</code> tag was found</span></p> </ol></div><p><br /><span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: <code>&lt;ref&gt;</code> tags exist for a group named "theGroup", but no corresponding <code>&lt;references group="theGroup"/&gt;</code> tag was found</span></p>
!! html/parsoid !! html/parsoid
<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> <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>
<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> <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>
<span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_invalid_parameters","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></div>
<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> <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>
<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> <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>
<span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_invalid_parameters","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></div>
<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> <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>
<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> <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>
<span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_invalid_parameters","params":[],"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></div>
!! end !! end
!! test !! test
@ -3354,3 +3369,27 @@ Sections:
Sections: Sections:
h2 index:1 toclevel:1 number:1 title:Parser_test off:0 anchor/linkAnchor:c[1] line:c<sup><span>[1]</span></sup> h2 index:1 toclevel:1 number:1 title:Parser_test off:0 anchor/linkAnchor:c[1] line:c<sup><span>[1]</span></sup>
!! end !! end
!! test
Non-diffing cite error
!! options
cat
parsoid="wt2html"
!! wikitext
<ref name="aaa" />
!! metadata
cat=Pages_with_reference_errors sort=
!! html/php
<p><sup id="cite_ref-aaa_1-0" class="reference"><a href="#cite_note-aaa-1"><span class="cite-bracket">&#91;</span>1<span class="cite-bracket">&#93;</span></a></sup>
</p>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-aaa-1"><span class="mw-cite-backlink"><a href="#cite_ref-aaa_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>aaa</code></span></li>
</ol></div>
!! html/parsoid
<p><sup class="mw-ref reference" id="cite_ref-aaa_1-0" rel="dc:references" typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"aaa"},"errors":[{"key":"cite_error_references_no_text","params":["aaa"]}]}'><a href="./Parser_test#cite_note-aaa-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" data-mw='{"name":"references","attrs":{},"autoGenerated":true}'>
<ol class="mw-references references">
<li id="cite_note-aaa-1"><span class="mw-cite-backlink"><a href="./Parser_test#cite_ref-aaa_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a></span> <span id="mw-reference-text-cite_note-aaa-1" class="mw-reference-text reference-text"></span><span typeof="mw:I18n" class="error mw-ext-cite-error" data-mw-i18n='{"/":{"lang":"x-user","key":"cite_error","params":{"0":{"key":"cite_error_references_no_text","params":{"0":{"text":"aaa","_type_":"Wikimedia\\Message\\ScalarParam"},"_type_":"array"},"_type_":"Wikimedia\\Message\\MessageValue"},"_type_":"array"}}}'></span></li>
</ol>
</div>
!! end

View file

@ -8,6 +8,8 @@ use Cite\Parsoid\References;
use MediaWiki\Config\Config; use MediaWiki\Config\Config;
use MediaWiki\Registration\ExtensionRegistry; use MediaWiki\Registration\ExtensionRegistry;
use Wikimedia\ObjectFactory\ObjectFactory; use Wikimedia\ObjectFactory\ObjectFactory;
use Wikimedia\Parsoid\Config\PageConfig;
use Wikimedia\Parsoid\Core\ContentMetadataCollector;
use Wikimedia\Parsoid\Core\SelserData; use Wikimedia\Parsoid\Core\SelserData;
use Wikimedia\Parsoid\DOM\Element; use Wikimedia\Parsoid\DOM\Element;
use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI; use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI;
@ -20,6 +22,7 @@ use Wikimedia\Parsoid\Parsoid;
use Wikimedia\Parsoid\Utils\DOMCompat; use Wikimedia\Parsoid\Utils\DOMCompat;
use Wikimedia\Parsoid\Utils\DOMDataUtils; use Wikimedia\Parsoid\Utils\DOMDataUtils;
use Wikimedia\Parsoid\Utils\DOMUtils; use Wikimedia\Parsoid\Utils\DOMUtils;
use Wikimedia\Parsoid\Utils\TitleValue;
/** /**
* @coversDefaultClass \Cite\Parsoid\Cite * @coversDefaultClass \Cite\Parsoid\Cite
@ -91,7 +94,21 @@ class CiteParsoidTest extends \MediaWikiIntegrationTestCase {
$siteOptions = [ 'linting' => true ] + $options; $siteOptions = [ 'linting' => true ] + $options;
$siteConfig = $this->getSiteConfig( $siteOptions ); $siteConfig = $this->getSiteConfig( $siteOptions );
$dataAccess = new MockDataAccess( $siteConfig, [] ); $dataAccess = new class( $siteConfig, [] ) extends MockDataAccess {
/** @inheritDoc */
public function addTrackingCategory(
PageConfig $pageConfig,
ContentMetadataCollector $metadata,
string $key
): void {
if ( $key === 'cite-tracking-category-cite-error' ) {
$tv = TitleValue::tryNew( 14, 'Pages with reference errors' );
$metadata->addCategory( $tv );
return;
}
parent::addTrackingCategory( $pageConfig, $metadata, $key );
}
};
$parsoid = new Parsoid( $siteConfig, $dataAccess ); $parsoid = new Parsoid( $siteConfig, $dataAccess );
$content = new MockPageContent( [ $opts['pageName'] => $wt ] ); $content = new MockPageContent( [ $opts['pageName'] => $wt ] );