MediaWiki master
MediaWiki\Parser\StripState Class Reference
Collaboration diagram for MediaWiki\Parser\StripState:

Public Member Functions

 __construct (?Parser $parser=null, $options=[])
 
 addExtTag ( $marker, $value)
 
 addGeneral ( $marker, $value)
 
 addNoWiki ( $marker, $value)
 Add a nowiki strip item.
 
 getLimitReport ()
 Get an array of parameters to pass to ParserOutput::setLimitReportData()
 
 killMarkers ( $text)
 Remove any strip markers found in the given text.
 
 replaceNoWikis (string $text, callable $callback)
 
 split (string $text)
 Split the given text by strip markers, returning an array that alternates between plain text and strip marker information.
 
 unstripBoth ( $text)
 
 unstripGeneral ( $text)
 
 unstripNoWiki ( $text)
 

Protected Member Functions

 addItem ( $type, $marker, $value)
 
 unstripType ( $type, $text)
 

Protected Attributes

array $circularRefGuard
 
array[] $data
 
int $depth = 0
 
int $depthLimit = 20
 
int $expandSize = 0
 
int $highestDepth = 0
 
Parser $parser
 
string $regex
 
int $sizeLimit = 5_000_000
 

Detailed Description

Todo
document, briefly.
Stability: newable

Definition at line 34 of file StripState.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\StripState::__construct ( ?Parser $parser = null,
$options = [] )
Stability: stable
to call
Parameters
Parser | null$parser
array$options

Definition at line 62 of file StripState.php.

References MediaWiki\Parser\StripState\$parser, and MediaWiki\Parser\Parser\MARKER_PREFIX.

Member Function Documentation

◆ addExtTag()

MediaWiki\Parser\StripState::addExtTag ( $marker,
$value )
Parameters
string$marker
string | Closure$value
Since
1.44
Access: internal
Parsoid use only.

Definition at line 102 of file StripState.php.

References MediaWiki\Parser\StripState\addItem().

◆ addGeneral()

MediaWiki\Parser\StripState::addGeneral ( $marker,
$value )
Parameters
string$marker
string | Closure$value

Definition at line 92 of file StripState.php.

References MediaWiki\Parser\StripState\addItem().

◆ addItem()

MediaWiki\Parser\StripState::addItem ( $type,
$marker,
$value )
protected
Parameters
string$type
string$marker
string | Closure$value

Definition at line 114 of file StripState.php.

Referenced by MediaWiki\Parser\StripState\addExtTag(), MediaWiki\Parser\StripState\addGeneral(), and MediaWiki\Parser\StripState\addNoWiki().

◆ addNoWiki()

MediaWiki\Parser\StripState::addNoWiki ( $marker,
$value )

Add a nowiki strip item.

Parameters
string$marker
string | Closure$value

Definition at line 84 of file StripState.php.

References MediaWiki\Parser\StripState\addItem().

◆ getLimitReport()

MediaWiki\Parser\StripState::getLimitReport ( )

Get an array of parameters to pass to ParserOutput::setLimitReportData()

Access: internal
Should only be called by Parser
Returns
array

Definition at line 296 of file StripState.php.

◆ killMarkers()

MediaWiki\Parser\StripState::killMarkers ( $text)

Remove any strip markers found in the given text.

Parameters
string$text
Returns
string

Definition at line 319 of file StripState.php.

◆ replaceNoWikis()

MediaWiki\Parser\StripState::replaceNoWikis ( string $text,
callable $callback )
Parameters
string$text
callable$callback
Returns
string

Definition at line 143 of file StripState.php.

◆ split()

MediaWiki\Parser\StripState::split ( string $text)

Split the given text by strip markers, returning an array that alternates between plain text and strip marker information.

The strip marker information includes 'type', and 'content'. The resulting array will always be at least 1 element long and contain an odd number of elements.

Returns
array<string|array{type:string,content:string}>

Definition at line 179 of file StripState.php.

◆ unstripBoth()

MediaWiki\Parser\StripState::unstripBoth ( $text)
Parameters
string$text
Returns
mixed

Definition at line 205 of file StripState.php.

◆ unstripGeneral()

MediaWiki\Parser\StripState::unstripGeneral ( $text)
Parameters
string$text
Returns
mixed

Definition at line 126 of file StripState.php.

References MediaWiki\Parser\StripState\unstripType().

◆ unstripNoWiki()

MediaWiki\Parser\StripState::unstripNoWiki ( $text)
Parameters
string$text
Returns
mixed

Definition at line 134 of file StripState.php.

References MediaWiki\Parser\StripState\unstripType().

◆ unstripType()

MediaWiki\Parser\StripState::unstripType ( $type,
$text )
protected
Parameters
string$type
string$text
Returns
mixed

Definition at line 216 of file StripState.php.

Referenced by MediaWiki\Parser\StripState\unstripGeneral(), and MediaWiki\Parser\StripState\unstripNoWiki().

Member Data Documentation

◆ $circularRefGuard

array MediaWiki\Parser\StripState::$circularRefGuard
protected

Definition at line 43 of file StripState.php.

◆ $data

array [] MediaWiki\Parser\StripState::$data
protected

Definition at line 36 of file StripState.php.

◆ $depth

int MediaWiki\Parser\StripState::$depth = 0
protected

Definition at line 45 of file StripState.php.

◆ $depthLimit

int MediaWiki\Parser\StripState::$depthLimit = 20
protected

Definition at line 52 of file StripState.php.

◆ $expandSize

int MediaWiki\Parser\StripState::$expandSize = 0
protected

Definition at line 49 of file StripState.php.

◆ $highestDepth

int MediaWiki\Parser\StripState::$highestDepth = 0
protected

Definition at line 47 of file StripState.php.

◆ $parser

Parser MediaWiki\Parser\StripState::$parser
protected

Definition at line 40 of file StripState.php.

Referenced by MediaWiki\Parser\StripState\__construct().

◆ $regex

string MediaWiki\Parser\StripState::$regex
protected

Definition at line 38 of file StripState.php.

◆ $sizeLimit

int MediaWiki\Parser\StripState::$sizeLimit = 5_000_000
protected

Definition at line 54 of file StripState.php.


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