MediaWiki master
MediaWiki\Parser\Parsoid\ParsoidParser Class Reference

Parser implementation which uses Parsoid. More...

Public Member Functions

 __construct (private Parsoid $parsoid, private readonly PageConfigFactory $pageConfigFactory, private readonly LanguageConverterFactory $languageConverterFactory, private readonly SiteConfig $siteConfig, private readonly DataAccess $dataAccess, private readonly NamespaceInfo $namespaceInfo, private readonly TrackingCategories $trackingCategories,)
 
 addMetadata (ParserOutput $parserOutput, PageConfig $pageConfig)
 Add Parsoid-specific metadata to the final ParserOutput.
 
 parse ( $text, PageReference $page, ParserOptions $options, bool $linestart=true, bool $clearState=true, ?int $revId=null, ?ParserOutput $previousOutput=null)
 Convert wikitext to HTML Do not call this function recursively.
 

Detailed Description

Parser implementation which uses Parsoid.

Currently incomplete; see T236809 for the long-term plan.

Since
1.41
Stability: unstable
since 1.41; see T236809 for plan.

This class can generate the following messages through the Parsoid library. Although they are not used within MediaWiki core, their translations should be kept:

  • apierror-imagelimitexceeded

Definition at line 41 of file ParsoidParser.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\ParsoidParser::__construct ( private Parsoid $parsoid,
private readonly PageConfigFactory $pageConfigFactory,
private readonly LanguageConverterFactory $languageConverterFactory,
private readonly SiteConfig $siteConfig,
private readonly DataAccess $dataAccess,
private readonly NamespaceInfo $namespaceInfo,
private readonly TrackingCategories $trackingCategories )

Definition at line 42 of file ParsoidParser.php.

Member Function Documentation

◆ addMetadata()

MediaWiki\Parser\Parsoid\ParsoidParser::addMetadata ( ParserOutput $parserOutput,
PageConfig $pageConfig )

Add Parsoid-specific metadata to the final ParserOutput.

This is split into its own function to allow it to be invoked by ParserTestRunner.

Access: internal

Definition at line 213 of file ParsoidParser.php.

References MediaWiki\Parser\ParserOutput\getPageProperty(), and MediaWiki\Parser\ParserOutput\setIndexPolicy().

◆ parse()

MediaWiki\Parser\Parsoid\ParsoidParser::parse ( $text,
PageReference $page,
ParserOptions $options,
bool $linestart = true,
bool $clearState = true,
?int $revId = null,
?ParserOutput $previousOutput = null )

Convert wikitext to HTML Do not call this function recursively.

Parameters
string | TextContent$textText we want to parse
PageReference$page
ParserOptions$options
bool$linestart
bool$clearState
int | null$revIdID of the revision being rendered. This is used to render REVISION* magic words. 0 means that any current revision will be used. Null means that {{REVISIONID}}/{{REVISIONUSER}} will be empty and {{REVISIONTIMESTAMP}} will use the current timestamp.
?ParserOutput$previousOutputThe (optional) result of a previous parse of this page, which can be used for selective update.
Returns
ParserOutput
Stability: unstable
since 1.41

Definition at line 284 of file ParsoidParser.php.


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