Converts a stream of HTMLPurifier_Token into an HTMLPurifier_Node, and back again.
More...
|
static | arborize ($tokens, $config, $context) |
|
static | flatten ($node, $config, $context) |
|
Converts a stream of HTMLPurifier_Token into an HTMLPurifier_Node, and back again.
- Note
- This transformation is not an equivalence. We mutate the input token stream to make it so; see all [MUT] markers in code.
Definition at line 10 of file Arborize.php.
◆ arborize()
static HTMLPurifier_Arborize::arborize |
( |
|
$tokens, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
|
static |
Definition at line 12 of file Arborize.php.
References $config, $r, and array.
Referenced by HTMLPurifier_Strategy_FixNesting\execute().
13 $definition =
$config->getHTMLDefinition();
15 $stack =
array($parent->toNode());
16 foreach ($tokens as $token) {
18 $token->carryover = null;
21 $r = array_pop($stack);
24 $r->endCol = $token->col;
25 $r->endLine = $token->line;
26 $r->endArmor = $token->armor;
29 $node = $token->toNode();
30 $stack[count($stack)-1]->children[] = $node;
Concrete end token class.
Concrete start token class.
Create styles array
The data for the language used.
◆ flatten()
static HTMLPurifier_Arborize::flatten |
( |
|
$node, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
|
static |
Definition at line 39 of file Arborize.php.
References $end, and array.
Referenced by HTMLPurifier_Strategy_FixNesting\execute().
42 $closingTokens =
array();
45 while (!$nodes[$level]->isEmpty()) {
46 $node = $nodes[$level]->shift();
47 list($start,
$end) = $node->toTokenPair();
52 $closingTokens[$level][] =
$end;
57 foreach ($node->children as $childNode) {
58 $nodes[$level]->push($childNode);
63 if ($level && isset($closingTokens[$level])) {
64 while ($token = array_pop($closingTokens[$level])) {
Concrete element node class.
A simple array-backed queue, based off of the classic Okasaki persistent amortized queue...
Create styles array
The data for the language used.
The documentation for this class was generated from the following file:
- libs/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php