MediaWiki master
MediaWiki\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.
 
static parserOutputFromPageBundle (PageBundle $pageBundle, ?ParserOutput $originalParserOutput=null)
 Creates a ParserOutput object containing the relevant data from the given PageBundle object.
 

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 16 of file PageBundleParserOutputConverter.php.

Member Function Documentation

◆ hasPageBundle()

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

◆ pageBundleFromParserOutput()

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

Returns a Parsoid PageBundle equivalent to the given ParserOutput.

Parameters
ParserOutput$parserOutput
Returns
PageBundle

Definition at line 83 of file PageBundleParserOutputConverter.php.

◆ parserOutputFromPageBundle()

static MediaWiki\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$originalParserOutputAny non-parsoid metadata from $originalParserOutput will be copied into the new ParserOutput object.
Returns
ParserOutput

Definition at line 43 of file PageBundleParserOutputConverter.php.

References MediaWiki\Parser\ParserOutput\mergeHtmlMetaDataFrom().


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