MediaWiki  1.28.0
BlockLevelPass Class Reference

Static Public Member Functions

static doBlockLevels ($text, $lineStart)
 Make lists from lines starting with ':', '*', '#', etc. More...
 

Public Attributes

const COLON_STATE_CLOSETAG = 3
 
const COLON_STATE_COMMENT = 5
 
const COLON_STATE_COMMENTDASH = 6
 
const COLON_STATE_COMMENTDASHDASH = 7
 
const COLON_STATE_TAG = 1
 
const COLON_STATE_TAGSLASH = 4
 
const COLON_STATE_TAGSTART = 2
 
const COLON_STATE_TEXT = 0
 

Private Member Functions

 __construct ($text, $lineStart)
 Private constructor. More...
 
 closeList ($char)
 Close the current list item identified by the prefix character. More...
 
 closeParagraph ()
 If a pre or p is open, return the corresponding close tag and update the state. More...
 
 execute ()
 Execute the pass. More...
 
 findColonNoLinks ($str, &$before, &$after)
 Split up a string on ':', ignoring any occurrences inside tags to prevent illegal overlapping. More...
 
 getCommon ($st1, $st2)
 getCommon() returns the length of the longest common substring of both arguments, starting at the beginning of both. More...
 
 nextItem ($char)
 Close the current list item and open the next one. More...
 
 openList ($char)
 Open the list item element identified by the prefix character. More...
 

Private Attributes

 $DTopen = false
 
 $inPre = false
 
 $lastSection = ''
 
 $linestart
 
 $text
 

Detailed Description

Definition at line 25 of file BlockLevelPass.php.

Constructor & Destructor Documentation

BlockLevelPass::__construct (   $text,
  $lineStart 
)
private

Private constructor.

Definition at line 57 of file BlockLevelPass.php.

References $text, and text.

Member Function Documentation

BlockLevelPass::closeList (   $char)
private

Close the current list item identified by the prefix character.

Parameters
string$char
Returns
string

Definition at line 154 of file BlockLevelPass.php.

References $text.

Referenced by execute().

BlockLevelPass::closeParagraph ( )
private

If a pre or p is open, return the corresponding close tag and update the state.

If no tag is open, return an empty string.

Returns
string

Definition at line 67 of file BlockLevelPass.php.

Referenced by execute(), and openList().

static BlockLevelPass::doBlockLevels (   $text,
  $lineStart 
)
static

Make lists from lines starting with ':', '*', '#', etc.

Parameters
string$text
bool$lineStartWhether or not this is at the start of a line.
Returns
string The lists rendered as HTML

Definition at line 49 of file BlockLevelPass.php.

References $text.

Referenced by Parser\doBlockLevels().

BlockLevelPass::execute ( )
private
BlockLevelPass::findColonNoLinks (   $str,
$before,
$after 
)
private

Split up a string on ':', ignoring any occurrences inside tags to prevent illegal overlapping.

Parameters
string$strThe string to split
string&$beforeSet to everything before the ':'
string&$afterSet to everything after the ':'
Exceptions
MWException
Returns
string The position of the ':', or false if none found

Definition at line 391 of file BlockLevelPass.php.

References wfDebug().

Referenced by execute().

BlockLevelPass::getCommon (   $st1,
  $st2 
)
private

getCommon() returns the length of the longest common substring of both arguments, starting at the beginning of both.

Parameters
string$st1
string$st2
Returns
int

Definition at line 86 of file BlockLevelPass.php.

Referenced by execute().

BlockLevelPass::nextItem (   $char)
private

Close the current list item and open the next one.

Parameters
string$char
Returns
string

Definition at line 129 of file BlockLevelPass.php.

Referenced by execute().

BlockLevelPass::openList (   $char)
private

Open the list item element identified by the prefix character.

Parameters
string$char
Returns
string

Definition at line 104 of file BlockLevelPass.php.

References closeParagraph().

Referenced by execute().

Member Data Documentation

BlockLevelPass::$DTopen = false
private

Definition at line 26 of file BlockLevelPass.php.

BlockLevelPass::$inPre = false
private

Definition at line 27 of file BlockLevelPass.php.

BlockLevelPass::$lastSection = ''
private

Definition at line 28 of file BlockLevelPass.php.

BlockLevelPass::$linestart
private

Definition at line 29 of file BlockLevelPass.php.

BlockLevelPass::$text
private

Definition at line 30 of file BlockLevelPass.php.

Referenced by __construct(), closeList(), doBlockLevels(), and execute().

const BlockLevelPass::COLON_STATE_CLOSETAG = 3

Definition at line 36 of file BlockLevelPass.php.

const BlockLevelPass::COLON_STATE_COMMENT = 5

Definition at line 38 of file BlockLevelPass.php.

const BlockLevelPass::COLON_STATE_COMMENTDASH = 6

Definition at line 39 of file BlockLevelPass.php.

const BlockLevelPass::COLON_STATE_COMMENTDASHDASH = 7

Definition at line 40 of file BlockLevelPass.php.

const BlockLevelPass::COLON_STATE_TAG = 1

Definition at line 34 of file BlockLevelPass.php.

const BlockLevelPass::COLON_STATE_TAGSLASH = 4

Definition at line 37 of file BlockLevelPass.php.

const BlockLevelPass::COLON_STATE_TAGSTART = 2

Definition at line 35 of file BlockLevelPass.php.

const BlockLevelPass::COLON_STATE_TEXT = 0

Definition at line 33 of file BlockLevelPass.php.


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