diff --git a/src/Parsoid/RefGroup.php b/src/Parsoid/RefGroup.php index 3a68b1143..346f8b053 100644 --- a/src/Parsoid/RefGroup.php +++ b/src/Parsoid/RefGroup.php @@ -117,7 +117,8 @@ class RefGroup { $li->insertBefore( $span, $reftextSpan ); foreach ( $ref->linkbacks as $i => $lb ) { - $span->appendChild( self::createLinkback( $lb, $refGroup, (string)( $i + 1 ), $ownerDoc, $env ) + $span->appendChild( + self::createLinkback( $lb, $refGroup, (string)( $i + 1 ), $ownerDoc, $env ) ); } } diff --git a/src/Parsoid/References.php b/src/Parsoid/References.php index 3d161f5c1..c9107c3a6 100644 --- a/src/Parsoid/References.php +++ b/src/Parsoid/References.php @@ -185,7 +185,10 @@ class References implements ExtensionTag, SerialHandler { ] ); DOMDataUtils::addTypeOf( $linkBack, 'mw:Extension/ref' ); - $dataParsoid = (object)[ 'src' => $nodeDp->src ]; + $dataParsoid = (object)[]; + if ( isset( $nodeDp->src ) ) { + $dataParsoid->src = $nodeDp->src; + } if ( isset( $nodeDp->dsr ) ) { $dataParsoid->dsr = $nodeDp->dsr; }