|
| 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 54 of file RemoveEmpty.php.
References HTMLPurifier_Injector\rewindOffset().
61 for ($i = count($this->inputZipper->back) - 1; $i >= 0; $i--, $deleted++) {
62 $next = $this->inputZipper->back[$i];
64 if ($next->is_whitespace) {
67 if ($this->removeNbsp && !isset($this->removeNbspExceptions[$token->name])) {
68 $plain = str_replace(
"\xC2\xA0",
"", $next->data);
69 $isWsOrNbsp = $plain ===
'' || ctype_space($plain);
78 if (isset($this->_exclude[$token->name])) {
81 $this->attrValidator->validateToken($token, $this->config, $this->context);
82 $token->armor[
'ValidateAttributes'] =
true;
83 if (isset($token->attr[
'id']) || isset($token->attr[
'name'])) {
86 $token = $deleted + 1;
87 for ($b = 0, $c = count($this->inputZipper->front); $b < $c; $b++) {
88 $prev = $this->inputZipper->front[$b];
89 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');
$context
HTMLPurifier_Context
Validates the attributes of a token.
$config
HTMLPurifier_Config
◆ $_exclude
HTMLPurifier_Injector_RemoveEmpty::$_exclude = array('colgroup' => 1, 'th' => 1, 'td' => 1, 'iframe' => 1) |
|
private |
◆ $attrValidator
HTMLPurifier_Injector_RemoveEmpty::$attrValidator |
|
private |
◆ $config
HTMLPurifier_Injector_RemoveEmpty::$config |
|
private |
◆ $context
HTMLPurifier_Injector_RemoveEmpty::$context |
|
private |
◆ $removeNbsp
HTMLPurifier_Injector_RemoveEmpty::$removeNbsp |
|
private |
◆ $removeNbspExceptions
HTMLPurifier_Injector_RemoveEmpty::$removeNbspExceptions |
|
private |
The documentation for this class was generated from the following file: