|
| prepare ($config, $context) |
|
| handleElement (&$token) |
|
| rewindOffset ($offset) |
| Rewind to a spot to re-perform processing. More...
|
|
| getRewindOffset () |
| Retrieves rewind offset, and then unsets it. More...
|
|
| prepare ($config, $context) |
| Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. More...
|
|
| checkNeeded ($config) |
| This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled. More...
|
|
| allowsElement ($name) |
| Tests if the context node allows a certain element. More...
|
|
| handleText (&$token) |
| Handler that is called when a text token is processed. More...
|
|
| handleElement (&$token) |
| Handler that is called when a start or empty token is processed. More...
|
|
| handleEnd (&$token) |
| Handler that is called when an end token is processed. More...
|
|
| notifyEnd ($token) |
| Notifier that is called when an end token is processed. More...
|
|
Definition at line 3 of file RemoveEmpty.php.
◆ handleElement()
HTMLPurifier_Injector_RemoveEmpty::handleElement |
( |
& |
$token | ) |
|
- Parameters
-
Reimplemented from HTMLPurifier_Injector.
Definition at line 61 of file RemoveEmpty.php.
62 {
64 return;
65 }
66 $next = false;
67 $deleted = 1;
68 for (
$i = count($this->inputZipper->back) - 1;
$i >= 0;
$i--, $deleted++) {
69 $next = $this->inputZipper->back[
$i];
71 if ($next->is_whitespace) {
72 continue;
73 }
74 if ($this->removeNbsp && !isset($this->removeNbspExceptions[
$token->name])) {
75 $plain = str_replace("\xC2\xA0", "", $next->data);
76 $isWsOrNbsp = $plain === '' || ctype_space($plain);
77 if ($isWsOrNbsp) {
78 continue;
79 }
80 }
81 }
82 break;
83 }
85 $this->attrValidator->validateToken(
$token, $this->config, $this->context);
86 $token->armor[
'ValidateAttributes'] =
true;
87 if (isset($this->exclude[
$token->name])) {
89 foreach ($this->exclude[
$token->name] as $elem) {
90 if (!isset(
$token->attr[$elem]))
$r =
false;
91 }
93 }
94 if (isset(
$token->attr[
'id']) || isset(
$token->attr[
'name'])) {
95 return;
96 }
98 for ($b = 0,
$c = count($this->inputZipper->front); $b <
$c; $b++) {
99 $prev = $this->inputZipper->front[$b];
101 continue;
102 }
103 break;
104 }
105
107 return;
108 }
109 }
rewindOffset($offset)
Rewind to a spot to re-perform processing.
Concrete end token class.
Concrete start token class.
Concrete text token class.
References $c, $i, $r, PHPMailer\PHPMailer\$token, and HTMLPurifier_Injector\rewindOffset().
◆ prepare()
HTMLPurifier_Injector_RemoveEmpty::prepare |
( |
|
$config, |
|
|
|
$context |
|
) |
| |
- Parameters
-
- Returns
- void
Reimplemented from HTMLPurifier_Injector.
Definition at line 41 of file RemoveEmpty.php.
42 {
46 $this->removeNbsp =
$config->get(
'AutoFormat.RemoveEmpty.RemoveNbsp');
47 $this->removeNbspExceptions =
$config->get(
'AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions');
48 $this->exclude =
$config->get(
'AutoFormat.RemoveEmpty.Predicate');
49 foreach ($this->exclude as
$key => $attrs) {
50 if (!is_array($attrs)) {
51
52 $this->exclude[
$key] = explode(
';', $attrs);
53 }
54 }
56 }
Validates the attributes of a token.
$config
@type HTMLPurifier_Config
$context
@type HTMLPurifier_Context
References $config, $context, and $key.
◆ $attrValidator
HTMLPurifier_Injector_RemoveEmpty::$attrValidator |
|
private |
◆ $config
HTMLPurifier_Injector_RemoveEmpty::$config |
|
private |
◆ $context
HTMLPurifier_Injector_RemoveEmpty::$context |
|
private |
◆ $exclude
HTMLPurifier_Injector_RemoveEmpty::$exclude |
|
private |
Cached contents of AutoFormat.RemoveEmpty.Predicate @type array.
Definition at line 34 of file RemoveEmpty.php.
◆ $removeNbsp
HTMLPurifier_Injector_RemoveEmpty::$removeNbsp |
|
private |
◆ $removeNbspExceptions
HTMLPurifier_Injector_RemoveEmpty::$removeNbspExceptions |
|
private |
The documentation for this class was generated from the following file:
- libs/composer/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveEmpty.php