|
| 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
-
Definition at line 61 of file RemoveEmpty.php.
References $r, and HTMLPurifier_Injector\rewindOffset().
68 for ($i = count($this->inputZipper->back) - 1; $i >= 0; $i--, $deleted++) {
69 $next = $this->inputZipper->back[$i];
71 if ($next->is_whitespace) {
74 if ($this->removeNbsp && !isset($this->removeNbspExceptions[$token->name])) {
75 $plain = str_replace(
"\xC2\xA0",
"", $next->data);
76 $isWsOrNbsp = $plain ===
'' || ctype_space($plain);
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;
94 if (isset($token->attr[
'id']) || isset($token->attr[
'name'])) {
97 $token = $deleted + 1;
98 for ($b = 0, $c = count($this->inputZipper->front); $b < $c; $b++) {
99 $prev = $this->inputZipper->front[$b];
100 if ($prev instanceof HTMLPurifier_Token_Text && $prev->is_whitespace) {
Concrete end token class.
Concrete start token class.
rewindOffset($offset)
Rewind to a spot to re-perform processing.
Concrete text token class.
◆ prepare()
HTMLPurifier_Injector_RemoveEmpty::prepare |
( |
|
$config, |
|
|
|
$context |
|
) |
| |
- Parameters
-
- Returns
- void
Definition at line 41 of file RemoveEmpty.php.
References $config, and $context.
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)) {
52 $this->exclude[$key] = explode(
';', $attrs);
$context
HTMLPurifier_Context
Validates the attributes of a token.
$config
HTMLPurifier_Config
◆ $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 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