summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Brahney <[email protected]>2020-08-24 16:28:50 +0100
committerKieran Brahney <[email protected]>2020-08-24 16:28:50 +0100
commit4f240ecbce5f51a5b76a9a3d6cf147fd83e83876 (patch)
treedb6727a5008c99b7d2ff947340ba89d85be72375
parentdb6e7e6f97d03f4857fc4dd70362290e546c0cdf (diff)
fix: character entity parsing
-rw-r--r--src/HTML5/Parser/Tokenizer.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/HTML5/Parser/Tokenizer.php b/src/HTML5/Parser/Tokenizer.php
index 0fd1ee7..300a446 100644
--- a/src/HTML5/Parser/Tokenizer.php
+++ b/src/HTML5/Parser/Tokenizer.php
@@ -1181,16 +1181,11 @@ class Tokenizer
return $entity;
}
- // If in an attribute, then failing to match ; means unconsume the
- // entire string. Otherwise, failure to match is an error.
- if ($inAttribute) {
- $this->scanner->unconsume($this->scanner->position() - $start);
-
- return '&';
- }
+ // Failing to match ; means unconsume the entire string.
+ $this->scanner->unconsume($this->scanner->position() - $start);
$this->parseError('Expected &ENTITY;, got &ENTITY%s (no trailing ;) ', $tok);
- return '&' . $entity;
+ return '&';
}
}