Switch some uses of matchTypeOf to hasTypeOf in Cite

Change-Id: I99986c337944547ae398851676de13377f4114b1
This commit is contained in:
Arlo Breault 2020-11-05 13:25:06 -05:00
parent c675396445
commit b2e2732674

View file

@ -119,7 +119,7 @@ class References extends ExtensionTagHandler {
// dsr computation and template wrapping.
$nodeDp = DOMDataUtils::getDataParsoid( $node );
$typeOf = $node->getAttribute( 'typeof' );
$isTplWrapper = DOMUtils::matchTypeOf( $node, '/^mw:Transclusion$/' );
$isTplWrapper = DOMUtils::hasTypeOf( $node, 'mw:Transclusion' );
$nodeType = preg_replace( '#mw:DOMFragment/sealed/ref#', '', $typeOf, 1 );
$contentId = $nodeDp->html;
$tplDmw = $isTplWrapper ? DOMDataUtils::getDataMw( $node ) : null;
@ -361,7 +361,7 @@ class References extends ExtensionTagHandler {
ParsoidExtensionAPI $extApi, DOMElement $refsNode,
ReferencesData $refsData, bool $autoGenerated = false
): void {
$isTplWrapper = DOMUtils::matchTypeOf( $refsNode, '/^mw:Transclusion$/' );
$isTplWrapper = DOMUtils::hasTypeOf( $refsNode, 'mw:Transclusion' );
$dp = DOMDataUtils::getDataParsoid( $refsNode );
$group = $dp->group ?? '';
$refGroup = $refsData->getRefGroup( $group );
@ -534,7 +534,7 @@ class References extends ExtensionTagHandler {
if ( $child instanceof DOMElement ) {
if ( WTUtils::isSealedFragmentOfType( $child, 'ref' ) ) {
self::extractRefFromNode( $extApi, $child, $refsData );
} elseif ( DOMUtils::matchTypeOf( $child, '#^mw:Extension/references$#' ) ) {
} elseif ( DOMUtils::hasTypeOf( $child, 'mw:Extension/references' ) ) {
$referencesGroup = DOMDataUtils::getDataParsoid( $child )->group ?? null;
$refsData->pushInEmbeddedContent();
self::processRefsInReferences(