MediaWiki master
|
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 | applyPageBundleDataToParserOutput ( $pageBundle, ParserOutput $parserOutput) |
Given an existing ParserOutput and a PageBundle, applies the PageBundle data to the ParserOutput. | |
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. | |
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.
Definition at line 16 of file PageBundleParserOutputConverter.php.
|
static |
Given an existing ParserOutput and a PageBundle, applies the PageBundle data to the ParserOutput.
NOTE: it does NOT apply the text of said pageBundle - this should be done by the calling method, if desired. This way, we can modify a ParserOutput's associated bundle without creating a new ParserOutput, which makes it easier to deal with in the OutputTransformPipeline.
PageBundle | \\stdClass | $pageBundle | |
ParserOutput | $parserOutput |
Definition at line 65 of file PageBundleParserOutputConverter.php.
References MediaWiki\Parser\ParserOutput\setLanguage().
|
static |
Definition at line 119 of file PageBundleParserOutputConverter.php.
References MediaWiki\Parser\ParserOutput\getExtensionData().
|
static |
Returns a Parsoid PageBundle equivalent to the given ParserOutput.
ParserOutput | $parserOutput |
Definition at line 97 of file PageBundleParserOutputConverter.php.
|
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.
PageBundle | $pageBundle | |
?ParserOutput | $originalParserOutput | Any non-parsoid metadata from $originalParserOutput will be copied into the new ParserOutput object. |
Definition at line 43 of file PageBundleParserOutputConverter.php.
References MediaWiki\Parser\ParserOutput\mergeHtmlMetaDataFrom().