|
static | flattenIfArray ( $a) |
| If $a is an array, this recursively flattens all nested arrays.
|
|
static | flattenString ( $c) |
| FIXME: document.
|
|
static | flattenStringlist (array $c) |
| FIXME: document.
|
|
static | getAttrVal ( $value, int $start, int $end) |
|
static | buildTableTokens (string $tagName, string $wtChar, $attrInfo, SourceRange $tsr, int $endPos, $content, bool $addEndTag=false) |
| Build a token array representing <tag>$content</tag> alongwith appropriate attributes and TSR info set on the tokens.
|
|
static | buildXMLTag (string $name, string $lcName, array $attribs, $endTag, bool $selfClose, SourceRange $tsr) |
| Build a token representing <tag>, <tag >, or </tag> with appropriate attributes set on the token.
|
|
static | inlineBreaks (string $input, int $pos, array $stops, Env $env) |
| Inline breaks, flag-enabled rule which detects end positions for active higher-level rules in inline and other nested rules.
|
|
static | popComments (array &$attrs) |
| Pop off the end comments, if any.
|
|
static | getAutoUrlTerminatingChars (bool $hasLeftParen) |
| Get a string containing all the autourl terminating characters (as in legacy parser Parser.php::makeFreeExternalLink).
|
|
static | enforceParserResourceLimits (Env $env, $token) |
|
static | protectAttrs (string $name) |
| Protect Parsoid-inserted attributes by escaping them to prevent Parsoid-HTML spoofing in wikitext.
|
|
static | resetAnnotationIncludeRegex () |
| Resets $inclAnnRegExp to null to avoid test environment side effects.
|
|
◆ buildTableTokens()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::buildTableTokens |
( |
string | $tagName, |
|
|
string | $wtChar, |
|
|
| $attrInfo, |
|
|
SourceRange | $tsr, |
|
|
int | $endPos, |
|
|
| $content, |
|
|
bool | $addEndTag = false ) |
|
static |
Build a token array representing <tag>$content</tag> alongwith appropriate attributes and TSR info set on the tokens.
- Parameters
-
string | $tagName | |
string | $wtChar | |
mixed | $attrInfo | |
SourceRange | $tsr | |
int | $endPos | |
mixed | $content | |
bool | $addEndTag | |
- Returns
- array (of tokens)
◆ buildXMLTag()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::buildXMLTag |
( |
string | $name, |
|
|
string | $lcName, |
|
|
array | $attribs, |
|
|
| $endTag, |
|
|
bool | $selfClose, |
|
|
SourceRange | $tsr ) |
|
static |
Build a token representing <tag>, <tag >, or </tag> with appropriate attributes set on the token.
- Parameters
-
string | $name | |
string | $lcName | |
array | $attribs | |
mixed | $endTag | |
bool | $selfClose | |
SourceRange | $tsr | |
- Returns
- Token
◆ enforceParserResourceLimits()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::enforceParserResourceLimits |
( |
Env | $env, |
|
|
| $token ) |
|
static |
◆ flattenIfArray()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::flattenIfArray |
( |
| $a | ) |
|
|
static |
If $a is an array, this recursively flattens all nested arrays.
- Parameters
-
- Returns
- mixed
◆ flattenString()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::flattenString |
( |
| $c | ) |
|
|
static |
FIXME: document.
- Parameters
-
- Returns
- mixed
◆ flattenStringlist()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::flattenStringlist |
( |
array | $c | ) |
|
|
static |
FIXME: document.
- Parameters
-
- Returns
- array
◆ getAttrVal()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::getAttrVal |
( |
| $value, |
|
|
int | $start, |
|
|
int | $end ) |
|
static |
- Parameters
-
mixed | $value | |
int | $start | start of TSR range |
int | $end | end of TSR range |
- Returns
- array
◆ getAutoUrlTerminatingChars()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::getAutoUrlTerminatingChars |
( |
bool | $hasLeftParen | ) |
|
|
static |
Get a string containing all the autourl terminating characters (as in legacy parser Parser.php::makeFreeExternalLink).
This list is slightly context-dependent because the inclusion of the right parenthesis depends on whether the provided character array $arr contains a left parenthesis.
- Parameters
-
bool | $hasLeftParen | should be true if the URL in question contains a left parenthesis. |
- Returns
- string
◆ inlineBreaks()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::inlineBreaks |
( |
string | $input, |
|
|
int | $pos, |
|
|
array | $stops, |
|
|
Env | $env ) |
|
static |
Inline breaks, flag-enabled rule which detects end positions for active higher-level rules in inline and other nested rules.
Those inner rules are then exited, so that the outer rule can handle the end marker.
- Parameters
-
string | $input | |
int | $pos | |
array | $stops | |
Env | $env | |
- Returns
- bool
- Exceptions
-
Exception
◆ popComments()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::popComments |
( |
array & | $attrs | ) |
|
|
static |
Pop off the end comments, if any.
- Parameters
-
- Returns
- array|null
◆ protectAttrs()
static Wikimedia\Parsoid\Wt2Html\TokenizerUtils::protectAttrs |
( |
string | $name | ) |
|
|
static |
Protect Parsoid-inserted attributes by escaping them to prevent Parsoid-HTML spoofing in wikitext.
- Parameters
-
- Returns
- string
The documentation for this class was generated from the following file:
- src/Wt2Html/TokenizerUtils.php