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 DataAccess $dataAccess,)
 
 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.
 
 parseFakeRevision (RevisionRecord $fakeRev, PageReference $page, ParserOptions $options)
 

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.

Definition at line 35 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 DataAccess $dataAccess )

Definition at line 36 of file ParsoidParser.php.

Member Function Documentation

◆ 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 236 of file ParsoidParser.php.

◆ parseFakeRevision()

MediaWiki\Parser\Parsoid\ParsoidParser::parseFakeRevision ( RevisionRecord $fakeRev,
PageReference $page,
ParserOptions $options )
Access: internal

Convert custom wikitext (stored in main slot of the $fakeRev arg) to HTML. Callers are expected NOT to stuff the result into ParserCache.

Parameters
RevisionRecord$fakeRevRevision to parse
PageReference$page
ParserOptions$options
Returns
ParserOutput
Stability: unstable
since 1.41

Definition at line 297 of file ParsoidParser.php.


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