|
MediaWiki master
|
This class allows HTML to be transformed to a page content source format such as wikitext. More...

Public Member Functions | |
| __construct (string $modifiedHTML, private readonly PageIdentity $page, private readonly Parsoid $parsoid, private readonly array $parsoidSettings, private readonly SiteConfig $siteConfig, private readonly PageConfigFactory $pageConfigFactory, private readonly IContentHandlerFactory $contentHandlerFactory,) | |
| getContentModel () | |
| getModifiedDocument () | |
| getModifiedHtmlSize () | |
| The size of the modified HTML in characters. | |
| getOffsetType () | |
| getOriginalDocument () | |
| Get the original document, for inspection. | |
| getOriginalRevisionId () | |
| getOriginalSchemaVersion () | |
| getSchemaVersion () | |
| Get the content version of the modified doc, if available. | |
| 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. | |
| htmlToContent () | |
| Returns a Content object derived from the supplied HTML. | |
| knowsOriginalContent () | |
| processOriginalHtml () | |
| NOTE: The return value of this method depends on setOriginalData() having been called first. | |
| setContentLanguage (Bcp47Code $lang) | |
| setMetrics (StatsFactory $metrics) | |
| Set metrics sink. | |
| setModifiedDataMW (array $modifiedDataMW) | |
| setOptions (array $options) | |
| setOriginalContent (Content $content) | |
| Sets the original content (such as wikitext). | |
| setOriginalDataMW (array $originalDataMW) | |
| setOriginalDataParsoid (array $originalDataParsoid) | |
| setOriginalHtml (string $originalHtml) | |
| setOriginalRevision (RevisionRecord $rev) | |
| setOriginalRevisionId (int $oldid) | |
| setOriginalSchemaVersion (string $originalSchemaVeraion) | |
| setOriginalText (string $text) | |
| Sets the original source text (usually wikitext). | |
Protected Member Functions | |
| parseHTML (string $html, bool $validateXMLNames=false) | |
Protected Attributes | |
| StatsFactory | $metrics = null |
This class allows HTML to be transformed to a page content source format such as wikitext.
Definition at line 42 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::__construct | ( | string | $modifiedHTML, |
| private readonly PageIdentity | $page, | ||
| private readonly Parsoid | $parsoid, | ||
| private readonly array | $parsoidSettings, | ||
| private readonly SiteConfig | $siteConfig, | ||
| private readonly PageConfigFactory | $pageConfigFactory, | ||
| private readonly IContentHandlerFactory | $contentHandlerFactory ) |
Definition at line 59 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::getContentModel | ( | ) |
Definition at line 391 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::getModifiedDocument | ( | ) |
Definition at line 277 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::getModifiedHtmlSize | ( | ) |
The size of the modified HTML in characters.
Definition at line 256 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::getOffsetType | ( | ) |
Definition at line 395 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::getOriginalDocument | ( | ) |
Get the original document, for inspection.
This is the raw document of the original page bundle. It does not have the data-parsoid and data-mw of the page bundle loaded into it. Do not pass it to Parsoid. Parsoid gets a loaded copy from getSelserData() instead.
Definition at line 290 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::getOriginalRevisionId | ( | ) |
Definition at line 383 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::getOriginalSchemaVersion | ( | ) |
Definition at line 360 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::getSchemaVersion | ( | ) |
Get the content version of the modified doc, if available.
NOTE: The return value of this method depends on setOriginalSchemaVersion() having been called first.
Definition at line 369 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::hasOriginalDataParsoid | ( | ) |
NOTE: The return value of this method depends on setOriginalData() having been called first.
Definition at line 308 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::hasOriginalHtml | ( | ) |
NOTE: The return value of this method depends on setOriginalData() having been called first.
Definition at line 299 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::htmlToContent | ( | ) |
Returns a Content object derived from the supplied HTML.
Definition at line 534 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::knowsOriginalContent | ( | ) |
Definition at line 387 of file HtmlToContentTransform.php.
|
protected |
| string | $html | |
| bool | $validateXMLNames |
| ClientError |
Definition at line 319 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::processOriginalHtml | ( | ) |
NOTE: The return value of this method depends on setOriginalData() having been called first.
| ClientError |
Definition at line 330 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setContentLanguage | ( | Bcp47Code | $lang | ) |
Definition at line 114 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setMetrics | ( | StatsFactory | $metrics | ) |
Set metrics sink.
Definition at line 76 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setModifiedDataMW | ( | array | $modifiedDataMW | ) |
| array | $modifiedDataMW |
| ClientError |
Definition at line 164 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOptions | ( | array | $options | ) |
Definition at line 87 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOriginalContent | ( | Content | $content | ) |
Sets the original content (such as wikitext).
Definition at line 133 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOriginalDataMW | ( | array | $originalDataMW | ) |
Definition at line 187 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOriginalDataParsoid | ( | array | $originalDataParsoid | ) |
Definition at line 201 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOriginalHtml | ( | string | $originalHtml | ) |
Definition at line 178 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOriginalRevision | ( | RevisionRecord | $rev | ) |
Definition at line 91 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOriginalRevisionId | ( | int | $oldid | ) |
Definition at line 103 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOriginalSchemaVersion | ( | string | $originalSchemaVeraion | ) |
Definition at line 174 of file HtmlToContentTransform.php.
| MediaWiki\Parser\Parsoid\HtmlToContentTransform::setOriginalText | ( | string | $text | ) |
Sets the original source text (usually wikitext).
Definition at line 125 of file HtmlToContentTransform.php.
|
protected |
Definition at line 57 of file HtmlToContentTransform.php.