|
MediaWiki master
|
Provides methods for conversion between HtmlPageBundle and ParserOutput. More...
Static Public Member Functions | |
| static | hasPageBundle (ParserOutput $parserOutput) |
| static | htmlPageBundleFromParserOutput (ParserOutput $parserOutput, SiteConfig $siteConfig, bool $bodyOnly=false,) |
| Returns a Parsoid HtmlPageBundle equivalent to the given ParserOutput. | |
| static | pageBundleFromParserOutput (ParserOutput $parserOutput) |
| Returns a Parsoid HtmlPageBundle equivalent to the given ParserOutput. | |
| static | parserOutputFromPageBundle (HtmlPageBundle $pageBundle, ?ParserOutput $originalParserOutput=null, ParsoidLinkTarget|PageReference|null $title=null, ?SiteConfig $siteConfig=null,) |
| Creates a ParserOutput object containing the relevant data from the given HtmlPageBundle object. | |
Provides methods for conversion between HtmlPageBundle and ParserOutput.
ParserOutput typically contains only the article content HTML (ie, without <body> tags), while a HtmlPageBundle can contain an entire document including <html> wrapper, metadata in the <head>, and article content inside a <body> tag.
Definition at line 40 of file PageBundleParserOutputConverter.php.
|
static |
Definition at line 205 of file PageBundleParserOutputConverter.php.
|
static |
Returns a Parsoid HtmlPageBundle equivalent to the given ParserOutput.
| ParserOutput | $parserOutput | |
| SiteConfig | $siteConfig | ParsoidSiteConfig service |
| bool | $bodyOnly | If false, returns a full document with metadata in the <head>. If true, the html section of the PageBundle returns the inner HTML of the <body> element only. |
Definition at line 135 of file PageBundleParserOutputConverter.php.
|
static |
Returns a Parsoid HtmlPageBundle equivalent to the given ParserOutput.
| ParserOutput | $parserOutput |
Definition at line 116 of file PageBundleParserOutputConverter.php.
|
static |
Creates a ParserOutput object containing the relevant data from the given HtmlPageBundle 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.
| HtmlPageBundle | $pageBundle | |
| ?ParserOutput | $originalParserOutput | Any non-parsoid metadata from $originalParserOutput will be copied into the new ParserOutput object. |
| ParsoidLinkTarget | PageReference | null | $title | The given title will be copied into the new ParserOutput object. |
| ?SiteConfig | $siteConfig |
Definition at line 71 of file PageBundleParserOutputConverter.php.