DOMPostProcess: Don't run extension dom processors on nested pipelines

* There is really no reason to run this once per nested pipeline
  since there is a lot of other processing that is skipped on
  nested pipelines.
* Eliminated the 'topLevel' arg to the wtPostProcess extension handler
  since that is no longer relevant.
* We may need to explicitly document this in the extension API spec.

Change-Id: Ib2508df736aeab9c649138249228647c00aaaef5
This commit is contained in:
Subramanya Sastry 2023-07-21 15:32:28 -05:00 committed by jenkins-bot
parent 39e08e48fd
commit 4ed31f499e

View file

@ -17,15 +17,13 @@ class RefProcessor extends DOMProcessor {
* @inheritDoc
*/
public function wtPostprocess(
ParsoidExtensionAPI $extApi, Node $node, array $options, bool $atTopLevel
ParsoidExtensionAPI $extApi, Node $node, array $options
): void {
if ( $atTopLevel ) {
$refsData = new ReferencesData();
References::processRefs( $extApi, $refsData, $node );
References::insertMissingReferencesIntoDOM( $extApi, $refsData, $node );
if ( count( $refsData->embeddedErrors ) > 0 ) {
References::addEmbeddedErrors( $extApi, $refsData, $node );
}
$refsData = new ReferencesData();
References::processRefs( $extApi, $refsData, $node );
References::insertMissingReferencesIntoDOM( $extApi, $refsData, $node );
if ( count( $refsData->embeddedErrors ) > 0 ) {
References::addEmbeddedErrors( $extApi, $refsData, $node );
}
}