mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-23 22:45:20 +00:00
Adding cite error ref in reference with mismatched group
Bug: T51538 Change-Id: I5492dbaebb7bca79e83be09fdcfe810eaef8c053
This commit is contained in:
parent
680df4379c
commit
703dc8dc05
|
@ -111,6 +111,7 @@ class References extends ExtensionTagHandler {
|
|||
ParsoidExtensionAPI $extApi, DOMElement $node, ReferencesData $refsData
|
||||
): void {
|
||||
$doc = $node->ownerDocument;
|
||||
$errs = [];
|
||||
|
||||
// This is data-parsoid from the dom fragment node that's gone through
|
||||
// dsr computation and template wrapping.
|
||||
|
@ -143,6 +144,13 @@ class References extends ExtensionTagHandler {
|
|||
// elt has a group attribute, what takes precedence?
|
||||
$groupName = $refDmw->attrs->group ?? $refsData->referencesGroup;
|
||||
|
||||
if (
|
||||
$refsData->inReferencesContent() &&
|
||||
$groupName !== $refsData->referencesGroup
|
||||
) {
|
||||
$errs[] = [ 'key' => 'cite_error_references_group_mismatch' ];
|
||||
}
|
||||
|
||||
// NOTE: This will have been trimmed in Utils::getExtArgInfo()'s call
|
||||
// to TokenUtils::kvToHash() and ExtensionHandler::normalizeExtOptions()
|
||||
$refName = $refDmw->attrs->name ?? '';
|
||||
|
@ -163,7 +171,6 @@ class References extends ExtensionTagHandler {
|
|||
$linkBack = $doc->createElement( 'sup' );
|
||||
|
||||
$ref = null;
|
||||
$errs = [];
|
||||
|
||||
$hasRefName = strlen( $refName ) > 0;
|
||||
$hasFollow = strlen( $followName ) > 0;
|
||||
|
|
Loading…
Reference in a new issue