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, ?string $extra=null)
 Add a nowiki strip item.
 
 addParsoidOpaque ( $marker, PFragment $extra)
 
 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 of [ 'type' => ..., 'content' => ... ] elements.
 
 unstripBoth ( $text)
 
 unstripGeneral ( $text)
 
 unstripNoWiki ( $text)
 

Protected Member Functions

 addItem ( $type, $marker, $value, $extra=null)
 
 unstripType ( $type, $text)
 

Protected Attributes

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

Detailed Description

Todo
document, briefly.
Stability: newable

Definition at line 35 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 65 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 108 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 98 of file StripState.php.

References MediaWiki\Parser\StripState\addItem().

◆ addItem()

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

Definition at line 131 of file StripState.php.

References MediaWiki\Parser\StripState\$extra.

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

◆ addNoWiki()

MediaWiki\Parser\StripState::addNoWiki ( $marker,
$value,
?string $extra = null )

Add a nowiki strip item.

Parameters
string$marker
string | Closure$value
?string$extraUsed to distinguish items added by <nowiki> from items added by other mechanisms.

Definition at line 90 of file StripState.php.

References MediaWiki\Parser\StripState\$extra, and MediaWiki\Parser\StripState\addItem().

◆ addParsoidOpaque()

MediaWiki\Parser\StripState::addParsoidOpaque ( $marker,
PFragment $extra )
Parameters
string$marker
PFragment$extra
Since
1.44
Access: internal
Parsoid use only.

Definition at line 118 of file StripState.php.

References MediaWiki\Parser\StripState\$extra, and 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 375 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 398 of file StripState.php.

◆ replaceNoWikis()

MediaWiki\Parser\StripState::replaceNoWikis ( string $text,
callable $callback )
Parameters
string$text
callable$callback
Returns
string
Stability: unstable
Temporarily used by Scribunto

Definition at line 164 of file StripState.php.

◆ split()

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

Split the given text by strip markers, returning an array of [ 'type' => ..., 'content' => ... ] elements.

The type property is:

  • 'string' for plain strings and 'exttag' strip markers
  • otherwise, name of the strip marker that generated the 'content' value
    Returns
    array<string|array{type:string,content:string}>

Definition at line 200 of file StripState.php.

◆ unstripBoth()

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

Definition at line 284 of file StripState.php.

◆ unstripGeneral()

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

Definition at line 146 of file StripState.php.

References MediaWiki\Parser\StripState\unstripType().

◆ unstripNoWiki()

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

Definition at line 154 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 295 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 46 of file StripState.php.

◆ $data

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

Definition at line 37 of file StripState.php.

◆ $depth

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

Definition at line 48 of file StripState.php.

◆ $depthLimit

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

Definition at line 55 of file StripState.php.

◆ $expandSize

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

Definition at line 52 of file StripState.php.

◆ $extra

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

◆ $highestDepth

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

Definition at line 50 of file StripState.php.

◆ $parser

Parser MediaWiki\Parser\StripState::$parser
protected

Definition at line 43 of file StripState.php.

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

◆ $regex

string MediaWiki\Parser\StripState::$regex
protected

Definition at line 41 of file StripState.php.

◆ $sizeLimit

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

Definition at line 57 of file StripState.php.


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