|
Parsoid
A bidirectional parser between wikitext and HTML5
|
A page bundle stores metadata and separated data-parsoid and data-mw content. More...
Inheritance diagram for Wikimedia\Parsoid\Core\BasePageBundle:
Collaboration diagram for Wikimedia\Parsoid\Core\BasePageBundle:Public Member Functions | |
| 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. | |
| toJsonArray () | |
Static Public Member Functions | |
| static | newFromJsonArray (array $json) |
A page bundle stores metadata and separated data-parsoid and 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 and HtmlPageBundle for similar structures which include the actual HTML/DOM content.
|
static |
Reimplemented in Wikimedia\Parsoid\Core\DomPageBundle, and Wikimedia\Parsoid\Core\HtmlPageBundle.
| Wikimedia\Parsoid\Core\BasePageBundle::toJsonArray | ( | ) |
Reimplemented in Wikimedia\Parsoid\Core\DomPageBundle, and Wikimedia\Parsoid\Core\HtmlPageBundle.
| Wikimedia\Parsoid\Core\BasePageBundle::validate | ( | string | $contentVersion, |
| ?string & | $errorMessage = null ) |
Check if this pagebundle is valid.
| string | $contentVersion | Document content version to validate against. |
| ?string | &$errorMessage | Error message will be returned here. |
| Wikimedia\Parsoid\Core\BasePageBundle::withDocument | ( | Document | $doc, |
| array | $fragments = [] ) |
Build an DomPageBundle by adding DOM contents to this base page bundle.
| Document | $doc | The owner Document |
| array<string,DocumentFragment> | $fragments Additional named DocumentFragments |
| Wikimedia\Parsoid\Core\BasePageBundle::withHtml | ( | string | $html, |
| array | $fragments = [] ) |
Build an HtmlPageBundle by adding HTML string contents to this base page bundle.
| string | $html | The main document HTML |
| array<string,string> | $fragments Additional named HTML fragments |