MediaWiki REL1_39
MediaWiki\Parser\Parsoid\HTMLTransform Class Reference
Collaboration diagram for MediaWiki\Parser\Parsoid\HTMLTransform:

Public Member Functions

 __construct (string $modifiedHTML, PageConfig $pageConfig, Parsoid $parsoid, array $parsoidSettings)
 
 getContentModel ()
 
 getModifiedDocument ()
 
 getModifiedHtmlSize ()
 The size of the modified HTML in characters.
 
 getOffsetType ()
 
 getOriginalBody ()
 NOTE: The return value of this method depends on setOriginalData() having been called first.
 
 getOriginalHtml ()
 Returns the original HTML, with any necessary processing applied.
 
 getOriginalRevisionId ()
 
 getOriginalSchemaVersion ()
 
 getSchemaVersion ()
 NOTE: The return value of this method depends on setOriginalData() having been called first.
 
 hasOriginalDataParsoid ()
 NOTE: The return value of this method depends on setOriginalData() having been called first.
 
 hasOriginalHtml ()
 NOTE: The return value of this method depends on setOriginalData() having been called first.
 
 htmlToWikitext ()
 
 setMetrics (StatsdDataFactoryInterface $metrics)
 
 setModifiedDataMW (array $modifiedDataMW)
 
 setOptions (array $options)
 
 setOriginalDataMW (array $originalDataMW)
 
 setOriginalDataParsoid (array $originalDataParsoid)
 
 setOriginalHtml (string $originalHtml)
 
 setOriginalRevisionId (int $oldid)
 
 setOriginalSchemaVersion (string $originalSchemaVeraion)
 

Protected Member Functions

 parseHTML (string $html, bool $validateXMLNames=false)
 

Protected Attributes

StatsdDataFactoryInterface $metrics = null
 A statistics aggregator.
 

Detailed Description

Stability: unstable

Definition at line 26 of file HTMLTransform.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\HTMLTransform::__construct ( string $modifiedHTML,
PageConfig $pageConfig,
Parsoid $parsoid,
array $parsoidSettings )
Parameters
string$modifiedHTML
PageConfig$pageConfig
Parsoid$parsoid
array$parsoidSettings

Definition at line 70 of file HTMLTransform.php.

Member Function Documentation

◆ getContentModel()

MediaWiki\Parser\Parsoid\HTMLTransform::getContentModel ( )

Definition at line 349 of file HTMLTransform.php.

◆ getModifiedDocument()

MediaWiki\Parser\Parsoid\HTMLTransform::getModifiedDocument ( )

Definition at line 204 of file HTMLTransform.php.

◆ getModifiedHtmlSize()

MediaWiki\Parser\Parsoid\HTMLTransform::getModifiedHtmlSize ( )

The size of the modified HTML in characters.

Returns
int

Definition at line 191 of file HTMLTransform.php.

◆ getOffsetType()

MediaWiki\Parser\Parsoid\HTMLTransform::getOffsetType ( )

Definition at line 353 of file HTMLTransform.php.

◆ getOriginalBody()

MediaWiki\Parser\Parsoid\HTMLTransform::getOriginalBody ( )

NOTE: The return value of this method depends on setOriginalData() having been called first.

Returns
Element
Exceptions
ClientError

Definition at line 285 of file HTMLTransform.php.

◆ getOriginalHtml()

MediaWiki\Parser\Parsoid\HTMLTransform::getOriginalHtml ( )

Returns the original HTML, with any necessary processing applied.

Todo
Make this method redundant, nothing should operate on HTML strings.
Returns
string

Definition at line 243 of file HTMLTransform.php.

◆ getOriginalRevisionId()

MediaWiki\Parser\Parsoid\HTMLTransform::getOriginalRevisionId ( )

Definition at line 345 of file HTMLTransform.php.

◆ getOriginalSchemaVersion()

MediaWiki\Parser\Parsoid\HTMLTransform::getOriginalSchemaVersion ( )

Definition at line 321 of file HTMLTransform.php.

◆ getSchemaVersion()

MediaWiki\Parser\Parsoid\HTMLTransform::getSchemaVersion ( )

NOTE: The return value of this method depends on setOriginalData() having been called first.

Returns
string

Definition at line 331 of file HTMLTransform.php.

◆ hasOriginalDataParsoid()

MediaWiki\Parser\Parsoid\HTMLTransform::hasOriginalDataParsoid ( )

NOTE: The return value of this method depends on setOriginalData() having been called first.

Returns
bool

Definition at line 232 of file HTMLTransform.php.

◆ hasOriginalHtml()

MediaWiki\Parser\Parsoid\HTMLTransform::hasOriginalHtml ( )

NOTE: The return value of this method depends on setOriginalData() having been called first.

Returns
bool

Definition at line 222 of file HTMLTransform.php.

◆ htmlToWikitext()

MediaWiki\Parser\Parsoid\HTMLTransform::htmlToWikitext ( )

Definition at line 464 of file HTMLTransform.php.

◆ parseHTML()

MediaWiki\Parser\Parsoid\HTMLTransform::parseHTML ( string $html,
bool $validateXMLNames = false )
protected
Parameters
string$html
bool$validateXMLNames
Returns
Document
Exceptions
ClientError

Definition at line 274 of file HTMLTransform.php.

◆ setMetrics()

MediaWiki\Parser\Parsoid\HTMLTransform::setMetrics ( StatsdDataFactoryInterface $metrics)
Parameters
StatsdDataFactoryInterface$metrics

Definition at line 86 of file HTMLTransform.php.

Referenced by MediaWiki\Rest\Handler\ParsoidHandler\getHTMLTransform().

◆ setModifiedDataMW()

MediaWiki\Parser\Parsoid\HTMLTransform::setModifiedDataMW ( array $modifiedDataMW)
Note
Call this after all original data has been set!
Parameters
array$modifiedDataMW

Definition at line 127 of file HTMLTransform.php.

◆ setOptions()

MediaWiki\Parser\Parsoid\HTMLTransform::setOptions ( array $options)

Definition at line 100 of file HTMLTransform.php.

◆ setOriginalDataMW()

MediaWiki\Parser\Parsoid\HTMLTransform::setOriginalDataMW ( array $originalDataMW)
Parameters
array$originalDataMW

Definition at line 159 of file HTMLTransform.php.

◆ setOriginalDataParsoid()

MediaWiki\Parser\Parsoid\HTMLTransform::setOriginalDataParsoid ( array $originalDataParsoid)
Parameters
array$originalDataParsoid

Definition at line 176 of file HTMLTransform.php.

◆ setOriginalHtml()

MediaWiki\Parser\Parsoid\HTMLTransform::setOriginalHtml ( string $originalHtml)
Parameters
string$originalHtml

Definition at line 147 of file HTMLTransform.php.

◆ setOriginalRevisionId()

MediaWiki\Parser\Parsoid\HTMLTransform::setOriginalRevisionId ( int $oldid)
Parameters
int$oldid

Definition at line 107 of file HTMLTransform.php.

◆ setOriginalSchemaVersion()

MediaWiki\Parser\Parsoid\HTMLTransform::setOriginalSchemaVersion ( string $originalSchemaVeraion)
Parameters
string$originalSchemaVeraion

Definition at line 140 of file HTMLTransform.php.

Member Data Documentation

◆ $metrics

StatsdDataFactoryInterface MediaWiki\Parser\Parsoid\HTMLTransform::$metrics = null
protected

A statistics aggregator.

Definition at line 47 of file HTMLTransform.php.


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