Parsoid
A bidirectional parser between wikitext and HTML5
|
PORT-FIXME: This is just a placeholder for data that was previously passed to entrypoint in JavaScript. More...
Public Member Functions | |
__construct (string $html, ?array $parsoid=null, ?array $mw=null, ?string $version=null, ?array $headers=null, ?string $contentmodel=null) | |
toDom () | |
toHtml () | |
validate (string $contentVersion, ?string &$errorMessage=null) | |
Check if this pagebundle is valid. | |
responseData () | |
encodeForHeadElement () | |
Encode some of these properties for emitting in the <head> element of a doc. | |
Static Public Member Functions | |
static | apply (Document $doc, PageBundle $pb) |
Applies the data-* attributes JSON structure to the document. | |
Public Attributes | |
$html | |
$parsoid | |
$mw | |
$version | |
$headers | |
$contentmodel | |
PORT-FIXME: This is just a placeholder for data that was previously passed to entrypoint in JavaScript.
Who will construct these objects and whether this is the correct interface is yet to be determined.
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.
|
static |
Applies the data-*
attributes JSON structure to the document.
Leaves id
attributes behind – they are used by citation code to extract <ref>
body from the DOM.
Document | $doc | doc |
PageBundle | $pb | page bundle |
Wikimedia\Parsoid\Core\PageBundle::encodeForHeadElement | ( | ) |
Encode some of these properties for emitting in the <head> element of a doc.
Wikimedia\Parsoid\Core\PageBundle::responseData | ( | ) |
Wikimedia\Parsoid\Core\PageBundle::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. |