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);
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];
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.