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');
62 for ($i = count($this->inputZipper->back) - 1; $i >= 0; $i--, $deleted++) {
63 $next = $this->inputZipper->back[$i];
65 if ($next->is_whitespace) {
68 if ($this->removeNbsp && !isset($this->removeNbspExceptions[$token->name])) {
69 $plain = str_replace(
"\xC2\xA0",
"", $next->data);
70 $isWsOrNbsp = $plain ===
'' || ctype_space($plain);
79 $this->attrValidator->validateToken($token, $this->config, $this->context);
80 $token->armor[
'ValidateAttributes'] =
true;
81 if (isset($this->exclude[$token->name])) {
83 foreach ($this->exclude[$token->name] as $elem) {
84 if (!isset($token->attr[$elem]))
$r =
false;
88 if (isset($token->attr[
'id']) || isset($token->attr[
'name'])) {
91 $token = $deleted + 1;
92 for ($b = 0, $c = count($this->inputZipper->front); $b < $c; $b++) {
93 $prev = $this->inputZipper->front[$b];
Concrete end token class.
$context
HTMLPurifier_Context
Validates the attributes of a token.
Concrete start token class.
$removeNbspExceptions
bool
prepare($config, $context)
$attrValidator
HTMLPurifier_AttrValidator
Injects tokens into the document while parsing for well-formedness.
$exclude
Cached contents of AutoFormat.RemoveEmpty.Predicate array.
rewindOffset($offset)
Rewind to a spot to re-perform processing.
$config
HTMLPurifier_Config
Concrete text token class.