MediaWiki REL1_28
BlockLevelPass Class Reference

Static Public Member Functions

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

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

Private Attributes

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

Detailed Description

Definition at line 25 of file BlockLevelPass.php.

Constructor & Destructor Documentation

◆ __construct()

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

Private constructor.

Definition at line 57 of file BlockLevelPass.php.

References $text, and text.

Member Function Documentation

◆ closeList()

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().

◆ closeParagraph()

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().

◆ doBlockLevels()

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().

◆ execute()

BlockLevelPass::execute ( )
private

Execute the pass.

Returns
string

Definition at line 176 of file BlockLevelPass.php.

References $output, $t, $term, $text, as, closeList(), closeParagraph(), StringUtils\explode(), findColonNoLinks(), getCommon(), nextItem(), and openList().

◆ findColonNoLinks()

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 COLON_STATE_CLOSETAG, COLON_STATE_COMMENT, COLON_STATE_COMMENTDASH, COLON_STATE_COMMENTDASHDASH, COLON_STATE_TAG, COLON_STATE_TAGSLASH, COLON_STATE_TAGSTART, COLON_STATE_TEXT, and wfDebug().

Referenced by execute().

◆ getCommon()

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().

◆ nextItem()

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().

◆ openList()

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

◆ $DTopen

BlockLevelPass::$DTopen = false
private

Definition at line 26 of file BlockLevelPass.php.

◆ $inPre

BlockLevelPass::$inPre = false
private

Definition at line 27 of file BlockLevelPass.php.

◆ $lastSection

BlockLevelPass::$lastSection = ''
private

Definition at line 28 of file BlockLevelPass.php.

◆ $linestart

BlockLevelPass::$linestart
private

Definition at line 29 of file BlockLevelPass.php.

◆ $text

BlockLevelPass::$text
private

Definition at line 30 of file BlockLevelPass.php.

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

◆ COLON_STATE_CLOSETAG

const BlockLevelPass::COLON_STATE_CLOSETAG = 3

Definition at line 36 of file BlockLevelPass.php.

Referenced by findColonNoLinks().

◆ COLON_STATE_COMMENT

const BlockLevelPass::COLON_STATE_COMMENT = 5

Definition at line 38 of file BlockLevelPass.php.

Referenced by findColonNoLinks().

◆ COLON_STATE_COMMENTDASH

const BlockLevelPass::COLON_STATE_COMMENTDASH = 6

Definition at line 39 of file BlockLevelPass.php.

Referenced by findColonNoLinks().

◆ COLON_STATE_COMMENTDASHDASH

const BlockLevelPass::COLON_STATE_COMMENTDASHDASH = 7

Definition at line 40 of file BlockLevelPass.php.

Referenced by findColonNoLinks().

◆ COLON_STATE_TAG

const BlockLevelPass::COLON_STATE_TAG = 1

Definition at line 34 of file BlockLevelPass.php.

Referenced by findColonNoLinks().

◆ COLON_STATE_TAGSLASH

const BlockLevelPass::COLON_STATE_TAGSLASH = 4

Definition at line 37 of file BlockLevelPass.php.

Referenced by findColonNoLinks().

◆ COLON_STATE_TAGSTART

const BlockLevelPass::COLON_STATE_TAGSTART = 2

Definition at line 35 of file BlockLevelPass.php.

Referenced by findColonNoLinks().

◆ COLON_STATE_TEXT

const BlockLevelPass::COLON_STATE_TEXT = 0

Definition at line 33 of file BlockLevelPass.php.

Referenced by findColonNoLinks().


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