An "HTML page bundle" stores an HTML string with separated data-parsoid and (optionally) data-mw content.
More...
|
| | responseData () |
| |
| | toSingleDocumentHtml (array $options=[]) |
| | Convert this HtmlPageBundle to "single document" form, where page bundle information is embedded in the <head> of the document.
|
| |
| | toInlineAttributeHtml (array $options=[], ?array &$fragments=null, ?SiteConfig $siteConfig=null) |
| | Convert this HtmlPageBundle to "inline attribute" form, where page bundle information is represented as inline JSON-valued attributes.
|
| |
| | toJsonArray () |
| |
| | validate (string $contentVersion, ?string &$errorMessage=null) |
| | Check if this pagebundle is valid.
|
| |
| | withHtml (string $html, array $fragments=[]) |
| | Build an HtmlPageBundle by adding HTML string contents to this base page bundle.
|
| |
| | withDocument (Document $doc, array $fragments=[]) |
| | Build an DomPageBundle by adding DOM contents to this base page bundle.
|
| |
|
| toBasePageBundle () |
| | Build a BasePageBundle with just the metadata from another page bundle.
|
| |
An "HTML page bundle" stores an HTML string with separated data-parsoid and (optionally) data-mw content.
The data-parsoid and data-mw content is indexed by the id attributes on individual nodes. This content needs to be loaded before the data-parsoid and/or data-mw information can be used.
Note that the parsoid/mw properties of the page bundle are in "serialized
array" form; that is, they are flat arrays appropriate for json-encoding and do not contain DataParsoid or DataMw objects.
See DomPageBundle for a similar structure used where the HTML string has been parsed into a DOM.
| static Wikimedia\Parsoid\Core\HtmlPageBundle::fromDomPageBundle |
( |
DomPageBundle | $dpb, |
|
|
array | $options = [] ) |
|
static |
Convert a DomPageBundle to an HtmlPageBundle.
This serializes the DOM from the DomPageBundle, with the given $options. The options can also provide defaults for content version, headers, content model, and offsetType if they weren't already set in the DomPageBundle.
- Parameters
-
| DomPageBundle | $dpb | |
| array | $options | XHtmlSerializer options |
- Returns
- self