|
MediaWiki master
|
Class allowing to explore the structure of parsed wikitext. More...
Public Member Functions | |
| __construct (private readonly ParserOutput $parserOutput, private readonly array $additionalExcludedSelectors=[],) | |
| getAuxiliaryText () | |
| getDefaultSort () | |
| Get the "defaultsort" property. | |
| getMainText () | |
| getOpeningText () | |
| headings () | |
| Gets headings from the page. | |
Static Public Member Functions | |
| static | parseSettingsInMessage ( $message) |
| Parse a message content into an array. | |
Class allowing to explore the structure of parsed wikitext.
Definition at line 13 of file WikiTextStructure.php.
| MediaWiki\Content\WikiTextStructure::__construct | ( | private readonly ParserOutput | $parserOutput, |
| private readonly array | $additionalExcludedSelectors = [] ) |
| ParserOutput | $parserOutput | |
| string[] | $additionalExcludedSelectors | CSS selectors for elements to remove from all text fields, on top of the built-in exclusions (since 1.47) |
Definition at line 65 of file WikiTextStructure.php.
| MediaWiki\Content\WikiTextStructure::getAuxiliaryText | ( | ) |
Definition at line 258 of file WikiTextStructure.php.
| MediaWiki\Content\WikiTextStructure::getDefaultSort | ( | ) |
Get the "defaultsort" property.
Definition at line 269 of file WikiTextStructure.php.
| MediaWiki\Content\WikiTextStructure::getMainText | ( | ) |
Definition at line 249 of file WikiTextStructure.php.
| MediaWiki\Content\WikiTextStructure::getOpeningText | ( | ) |
Definition at line 240 of file WikiTextStructure.php.
| MediaWiki\Content\WikiTextStructure::headings | ( | ) |
Gets headings from the page.
We also don't want to strip the tag and remove everything that looks like [2] because, I don't know, maybe there is a band named Word [2] Foo r something. Whatever.
So we only strip things that look like tags wrapping a reference. And since the data looks like: Reference in heading [1][2] we can not really use HtmlFormatter as we have no suitable selector.
Definition at line 88 of file WikiTextStructure.php.
|
static |
Parse a message content into an array.
This function is generally used to parse settings stored as i18n messages (see search-ignored-headings).
| string | $message |
Definition at line 126 of file WikiTextStructure.php.