extApi, $elt, function ( string $html ) { $dom = ContentUtils::createDocument( $html ); $body = DOMCompat::getBody( $dom ); DOMDataUtils::visitAndLoadDataAttribs( $body ); PipelineUtils::processContentInPipeline( $this->env, $this->env->topFrame, $body, [ 'pipelineType' => 'fullparse-embedded-docs-dom-to-dom', 'pipelineOpts' => [], 'sol' => true ], ); return ContentUtils::ppToXML( $body, [ 'innerXML' => true ] ); } ); $child = $elt->firstChild; while ( $child ) { if ( $child instanceof Element ) { $this->processNode( $child ); } $child = $child->nextSibling; } } /** * DOM Postprocessor entry function to walk DOM rooted at $root * and convert the DSR offsets as needed. * @see ConvertUtils::convertOffsets * * @inheritDoc */ public function run( Env $env, Node $root, array $options = [], bool $atTopLevel = false ): void { $this->env = $env; $this->extApi = new ParsoidExtensionAPI( $env ); '@phan-var Element $root'; $this->processNode( $root ); } }