MediaWiki master
MediaWiki\Parser\Parsoid\ParsoidParser Class Reference

Parser implementation which uses Parsoid. More...

Public Member Functions

 __construct (Parsoid $parsoid, PageConfigFactory $pageConfigFactory, LanguageConverterFactory $languageConverterFactory, ParserFactory $legacyParserFactory, GlobalIdGenerator $globalIdGenerator)
 
 parse (string $text, PageReference $page, ParserOptions $options, bool $linestart=true, bool $clearState=true, ?int $revId=null)
 Convert wikitext to HTML Do not call this function recursively.
 
 parseFakeRevision (RevisionRecord $fakeRev, PageReference $page, ParserOptions $options)
 

Public Attributes

const PARSOID_TITLE_KEY = "parsoid:title-dbkey"
 

Protected Member Functions

 makeLimitReport (ParserOptions $parserOptions, ParserOutput $parserOutput)
 Set the limit report data in the current ParserOutput.
 

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

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\Parsoid\ParsoidParser::__construct ( Parsoid $parsoid,
PageConfigFactory $pageConfigFactory,
LanguageConverterFactory $languageConverterFactory,
ParserFactory $legacyParserFactory,
GlobalIdGenerator $globalIdGenerator )
Parameters
Parsoid$parsoid
PageConfigFactory$pageConfigFactory
LanguageConverterFactory$languageConverterFactory
ParserFactory$legacyParserFactory
GlobalIdGenerator$globalIdGenerator

Definition at line 51 of file ParsoidParser.php.

Member Function Documentation

◆ makeLimitReport()

MediaWiki\Parser\Parsoid\ParsoidParser::makeLimitReport ( ParserOptions $parserOptions,
ParserOutput $parserOutput )
protected

Set the limit report data in the current ParserOutput.

This is ported from Parser::makeLimitReport() and should eventually use the method from the superclass directly.

Definition at line 292 of file ParsoidParser.php.

References CacheTime\getCacheExpiry(), CacheTime\getCacheTime(), ParserOptions\getMaxIncludeSize(), MediaWiki\Parser\ParserOutput\getTimeProfile(), MediaWiki\Parser\ParserOutput\hasReducedExpiry(), and MediaWiki\Parser\ParserOutput\setLimitReportData().

◆ parse()

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

Convert wikitext to HTML Do not call this function recursively.

Parameters
string$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.
Returns
ParserOutput
Stability: unstable
since 1.41

Definition at line 211 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 268 of file ParsoidParser.php.

References ParserOptions\getUserLangObj().

Member Data Documentation

◆ PARSOID_TITLE_KEY

const MediaWiki\Parser\Parsoid\ParsoidParser::PARSOID_TITLE_KEY = "parsoid:title-dbkey"
Stability: unstable
This should not be used widely right now since this may go away. This is being added to support DiscussionTools with Parsoid HTML and after initial exploration, this may be implemented differently.

Definition at line 37 of file ParsoidParser.php.


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