|
| prepare ($config, $context) |
|
| handleElement (&$token) |
|
| rewind ($index) |
| Rewind to a spot to re-perform processing. More...
|
|
| getRewind () |
| Retrieves rewind, 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 | ) |
|
Definition at line 20 of file RemoveEmpty.php.
References HTMLPurifier_Injector\rewind().
23 for ($i = $this->inputIndex + 1, $c = count($this->inputTokens); $i < $c; $i++) {
24 $next = $this->inputTokens[$i];
26 if ($next->is_whitespace)
continue;
27 if ($this->removeNbsp && !isset($this->removeNbspExceptions[$token->name])) {
28 $plain = str_replace(
"\xC2\xA0",
"", $next->data);
29 $isWsOrNbsp = $plain ===
'' || ctype_space($plain);
30 if ($isWsOrNbsp)
continue;
36 if (isset($this->_exclude[$token->name]))
return;
37 $this->attrValidator->validateToken($token, $this->config, $this->context);
38 $token->armor[
'ValidateAttributes'] =
true;
39 if (isset($token->attr[
'id']) || isset($token->attr[
'name']))
return;
40 $token = $i - $this->inputIndex + 1;
41 for ($b = $this->inputIndex - 1; $b > 0; $b--) {
42 $prev = $this->inputTokens[$b];
43 if ($prev instanceof HTMLPurifier_Token_Text && $prev->is_whitespace)
continue;
Concrete end token class.
Concrete start token class.
rewind($index)
Rewind to a spot to re-perform processing.
Concrete text token class.
◆ prepare()
HTMLPurifier_Injector_RemoveEmpty::prepare |
( |
|
$config, |
|
|
|
$context |
|
) |
| |
Definition at line 11 of file RemoveEmpty.php.
References $config, and $context.
15 $this->removeNbsp =
$config->get(
'AutoFormat.RemoveEmpty.RemoveNbsp');
16 $this->removeNbspExceptions =
$config->get(
'AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions');
Validates the attributes of a token.
◆ $_exclude
HTMLPurifier_Injector_RemoveEmpty::$_exclude = array('colgroup' => 1, 'th' => 1, 'td' => 1, 'iframe' => 1) |
|
private |
◆ $attrValidator
HTMLPurifier_Injector_RemoveEmpty::$attrValidator |
◆ $config
HTMLPurifier_Injector_RemoveEmpty::$config |
◆ $context
HTMLPurifier_Injector_RemoveEmpty::$context |
|
private |
◆ $removeNbsp
HTMLPurifier_Injector_RemoveEmpty::$removeNbsp |
◆ $removeNbspExceptions
HTMLPurifier_Injector_RemoveEmpty::$removeNbspExceptions |
The documentation for this class was generated from the following file: