Update ExtensionTagHandler::lintHandler implementations

I50557e0 changes the ExtensionTagHandler::lintHandler interface so it
can't return a node any more but must return true instead. True
indicates linting has been handled.

Depends-On: I441699e7fe9827a5e06e4638ce88c685deb9b856
Change-Id: I8fe4edc41a840c72cb539bf6f931d45ac777f8a0
This commit is contained in:
Arlo Breault 2024-04-12 20:33:37 -04:00
parent 8b21611cef
commit 84a8090248
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 */