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)
 
 toHtml ()
 
 validate (string $contentVersion, ?string &$errorMessage=null)
 Check if this pagebundle is valid.
 
 responseData ()
 

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.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Core\PageBundle::__construct ( string $html,
?array $parsoid = null,
?array $mw = null,
?string $version = null,
?array $headers = null,
?string $contentmodel = null )
Parameters
string$html
?array$parsoid
?array$mw
?string$version
?array$headers
?string$contentmodel

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

◆ 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: