MediaWiki master
MediaWiki\Content\WikiTextStructure Class Reference

Class allowing to explore the structure of parsed wikitext. More...

Public Member Functions

 __construct (ParserOutput $parserOutput)
 
 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.
 

Detailed Description

Class allowing to explore the structure of parsed wikitext.

Definition at line 12 of file WikiTextStructure.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Content\WikiTextStructure::__construct ( ParserOutput $parserOutput)
Parameters
ParserOutput$parserOutput

Definition at line 63 of file WikiTextStructure.php.

Member Function Documentation

◆ getAuxiliaryText()

MediaWiki\Content\WikiTextStructure::getAuxiliaryText ( )
Returns
string[]

Definition at line 245 of file WikiTextStructure.php.

◆ getDefaultSort()

MediaWiki\Content\WikiTextStructure::getDefaultSort ( )

Get the "defaultsort" property.

Returns
string|null

Definition at line 256 of file WikiTextStructure.php.

◆ getMainText()

MediaWiki\Content\WikiTextStructure::getMainText ( )
Returns
string

Definition at line 236 of file WikiTextStructure.php.

◆ getOpeningText()

MediaWiki\Content\WikiTextStructure::getOpeningText ( )
Returns
string|null

Definition at line 227 of file WikiTextStructure.php.

◆ headings()

MediaWiki\Content\WikiTextStructure::headings ( )

Gets headings from the page.

Returns
string[] First strip out things that look like references. We can't use HTML filtering because the references come back as tags without a class. To keep from breaking stuff like ==Applicability of the strict mass–energy equivalence formula, ''E'' = ''mc''2== we don't remove the whole tag.

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 84 of file WikiTextStructure.php.

◆ parseSettingsInMessage()

static MediaWiki\Content\WikiTextStructure::parseSettingsInMessage ( $message)
static

Parse a message content into an array.

This function is generally used to parse settings stored as i18n messages (see search-ignored-headings).

Parameters
string$message
Returns
string[]

Definition at line 122 of file WikiTextStructure.php.

References $lines.


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