20 $definition =
$config->getHTMLDefinition();
21 $e =&
$context->get(
'ErrorCollector',
true);
27 $context->register(
'IDAccumulator', $id_accumulator);
31 $current_token =&
$context->get(
'CurrentToken',
true);
32 if (!$current_token) {
44 $d_defs = $definition->info_global_attr;
51 foreach ($definition->info_attr_transform_pre as $transform) {
55 $e->send(E_NOTICE,
'AttrValidator: Attributes transformed', $o, $attr);
62 foreach ($definition->info[
$token->name]->attr_transform_pre as $transform) {
66 $e->send(E_NOTICE,
'AttrValidator: Attributes transformed', $o, $attr);
74 $defs = $definition->info[
$token->name]->attr;
77 $context->register(
'CurrentAttr', $attr_key);
81 foreach ($attr as $attr_key => $value) {
84 if (isset($defs[$attr_key])) {
86 if ($defs[$attr_key] ===
false) {
95 $result = $defs[$attr_key]->validate(
101 } elseif (isset($d_defs[$attr_key])) {
104 $result = $d_defs[$attr_key]->validate(
119 $e->send(E_ERROR,
'AttrValidator: Attribute removed');
123 unset($attr[$attr_key]);
124 } elseif (is_string(
$result)) {
147 foreach ($definition->info_attr_transform_post as $transform) {
151 $e->send(E_NOTICE,
'AttrValidator: Attributes transformed', $o, $attr);
157 foreach ($definition->info[
$token->name]->attr_transform_post as $transform) {
161 $e->send(E_NOTICE,
'AttrValidator: Attributes transformed', $o, $attr);
169 if (!$current_token) {
Validates the attributes of a token.
Concrete start token class.
validateToken($token, $config, $context)
Validates the attributes of a token, mutating it as necessary.
static build($config, $context)
Builds an IDAccumulator, also initializing the default blacklist.
Concrete empty token class.