MediaWiki  master
Parser\Parsoid\PageBundleParserOutputConverter Class Reference

Provides methods for conversion between PageBundle and ParserOutput TODO: Convert to a trait once we drop support for PHP < 8.2 since support for constants in traits was added in PHP 8.2. More...

Static Public Member Functions

static hasPageBundle (ParserOutput $parserOutput)
 
static pageBundleFromParserOutput (ParserOutput $parserOutput)
 Returns a Parsoid PageBundle equivalent to the given ParserOutput. More...
 
static parserOutputFromPageBundle (PageBundle $pageBundle, ?ParserOutput $originalParserOutput=null)
 Creates a ParserOutput object containing the relevant data from the given PageBundle object. More...
 

Detailed Description

Provides methods for conversion between PageBundle and ParserOutput TODO: Convert to a trait once we drop support for PHP < 8.2 since support for constants in traits was added in PHP 8.2.

Since
1.40
Access: internal

Definition at line 15 of file PageBundleParserOutputConverter.php.

Member Function Documentation

◆ hasPageBundle()

static Parser\Parsoid\PageBundleParserOutputConverter::hasPageBundle ( ParserOutput  $parserOutput)
static

◆ pageBundleFromParserOutput()

static Parser\Parsoid\PageBundleParserOutputConverter::pageBundleFromParserOutput ( ParserOutput  $parserOutput)
static

Returns a Parsoid PageBundle equivalent to the given ParserOutput.

Parameters
ParserOutput$parserOutput
Returns
PageBundle

Definition at line 74 of file PageBundleParserOutputConverter.php.

◆ parserOutputFromPageBundle()

static Parser\Parsoid\PageBundleParserOutputConverter::parserOutputFromPageBundle ( PageBundle  $pageBundle,
?ParserOutput  $originalParserOutput = null 
)
static

Creates a ParserOutput object containing the relevant data from the given PageBundle object.

We need to inject data-parsoid and other properties into the parser output object for caching, so we can use it for VE edits and transformations.

Parameters
PageBundle$pageBundle
?ParserOutput$originalParserOutput Any non-parsoid metadata from $originalParserOutput will be copied into the new ParserOutput object.
Returns
ParserOutput

Definition at line 42 of file PageBundleParserOutputConverter.php.

References ParserOutput\mergeHtmlMetaDataFrom().


The documentation for this class was generated from the following file: