Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Core\PageBundle Class Reference

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 <heaad> 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
 

Detailed Description

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.

Member Function Documentation

◆ apply()

static Wikimedia\Parsoid\Core\PageBundle::apply ( Document $doc,
PageBundle $pb )
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.

Parameters
Document$docdoc
PageBundle$pbpage bundle

◆ encodeForHeadElement()

Wikimedia\Parsoid\Core\PageBundle::encodeForHeadElement ( )

Encode some of these properties for emitting in the <heaad> element of a doc.

Returns
string

◆ responseData()

Wikimedia\Parsoid\Core\PageBundle::responseData ( )
Returns
array

◆ validate()

Wikimedia\Parsoid\Core\PageBundle::validate ( string $contentVersion,
?string & $errorMessage = null )

Check if this pagebundle is valid.

Parameters
string$contentVersionDocument content version to validate against.
?string&$errorMessageError message will be returned here.
Returns
bool

The documentation for this class was generated from the following file: