Merge "Update ExtensionTagHandler::lintHandler implementations"

This commit is contained in:
jenkins-bot 2024-04-22 04:55:02 +00:00 committed by Gerrit Code Review
commit 6ced9418ca
2 changed files with 4 additions and 5 deletions

View file

@ -8,7 +8,6 @@ use Closure;
use Exception;
use Wikimedia\Parsoid\DOM\DocumentFragment;
use Wikimedia\Parsoid\DOM\Element;
use Wikimedia\Parsoid\DOM\Node;
use Wikimedia\Parsoid\Ext\DOMDataUtils;
use Wikimedia\Parsoid\Ext\DOMUtils;
use Wikimedia\Parsoid\Ext\ExtensionTagHandler;
@ -70,7 +69,7 @@ class Ref extends ExtensionTagHandler {
/** @inheritDoc */
public function lintHandler(
ParsoidExtensionAPI $extApi, Element $ref, callable $defaultHandler
): ?Node {
): bool {
$dataMw = DOMDataUtils::getDataMw( $ref );
if ( isset( $dataMw->body->html ) ) {
$fragment = $extApi->htmlToDom( $dataMw->body->html );
@ -81,7 +80,7 @@ class Ref extends ExtensionTagHandler {
$defaultHandler( $refNode );
}
}
return $ref->nextSibling;
return true;
}
/** @inheritDoc */

View file

@ -804,13 +804,13 @@ class References extends ExtensionTagHandler {
/** @inheritDoc */
public function lintHandler(
ParsoidExtensionAPI $extApi, Element $refs, callable $defaultHandler
): ?Node {
): bool {
$dataMw = DOMDataUtils::getDataMw( $refs );
if ( isset( $dataMw->body->html ) ) {
$fragment = $extApi->htmlToDom( $dataMw->body->html );
$defaultHandler( $fragment );
}
return $refs->nextSibling;
return true;
}
/** @inheritDoc */