|
MediaWiki master
|
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. | |
Parser implementation which uses Parsoid.
Currently incomplete; see T236809 for the long-term 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:
Definition at line 41 of file ParsoidParser.php.
| 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.
| 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.
Definition at line 213 of file ParsoidParser.php.
References MediaWiki\Parser\ParserOutput\getPageProperty(), and MediaWiki\Parser\ParserOutput\setIndexPolicy().
| 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.
| string | TextContent | $text | Text we want to parse |
| PageReference | $page | |
| ParserOptions | $options | |
| bool | $linestart | |
| bool | $clearState | |
| int | null | $revId | ID 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 | $previousOutput | The (optional) result of a previous parse of this page, which can be used for selective update. |
Definition at line 284 of file ParsoidParser.php.