__construct()
parse()
render()
_findInStack()
_getTagRule()
_mergeTrailingText()
_parseTag()
_parseTagClose()
_parseTagOpen()
_pushTagClose()
_pushTagOpen()
_pushText()
_resetParser()
$_context
$_formatter
$_parserStates
$_position
$_tagList
$_tagStack
$_text
$_trailingText
$_tree
BB code parser and renderer.
package | XenForo_BbCode |
---|
__construct(\XenForo_BbCode_Formatter_Base $formatter)
parse(string $text) : array
string
array
render(string | array $text, array $extraStates) : string
string
array
If array, is assumed to be an already parsed version
array
A list of extra states to pass into the formatter
string
_findInStack(string $tagName) : array | false
If an array is returned, the last entry is the correct stack entry. Any other entries are tags that were opened before this but not closed (inner most first). These tags should be re-opened after closing this to force valid nesting.
string
Name of the tag to find
array
false
_getTagRule(string $tagName) : array | false
string
array
false
_mergeTrailingText()
_parseTag() : boolean
boolean
False if no more valid tags can possibly found; true otherwise_parseTagClose(integer $tagStartPosition, integer $tagEndPosition, integer $tagContentEndPosition) : boolean
The "[" has already been matched.
integer
Position of the "["
integer
Position after the "]". May be modified if necessary.
integer
Position of the "]"
boolean
False if no more valid tags can possibly found; true otherwise_parseTagOpen(integer $tagStartPosition, integer $tagEndPosition, integer $tagContentEndPosition) : boolean
The "[" has already been matched.
integer
Position of the "["
integer
Position after the "]". May be modified if necessary.
integer
Position of the "]"
boolean
False if no more valid tags can possibly found; true otherwise_pushTagClose(string $tagName, string $originalText)
string
Name of the tag that was found
string
Original, plain text version of the matched tag (including [ and ])
_pushTagOpen(string $tagName, string | null $tagOption, string $originalText)
string
Name of the tag that was found
string
null
Value for the tag's option
string
Original, plain text version of the matched tag (including [ and ])
_pushText(string $text)
string
_resetParser()
$_context : array
$_formatter : \XenForo_BbCode_Formatter_Base
$_parserStates : array
Can include things like "plainText", etc.
$_position : integer
Parsing will only occur from this point on.
$_tagList : array
$_tagStack : array
$_text : string
$_trailingText : string
Used to fold multiple text entries together.
$_tree : array
This will only be populated while parsing. Format: strings are literal text; arrays are tag openings, with keys: * tag - tag name (lower case) * option - value for the tag's option * children - array of more children (same format as the whole tree)