diff options
author | Kieran Brahney <[email protected]> | 2020-08-24 16:28:50 +0100 |
---|---|---|
committer | Kieran Brahney <[email protected]> | 2020-08-24 16:28:50 +0100 |
commit | 4f240ecbce5f51a5b76a9a3d6cf147fd83e83876 (patch) | |
tree | db6727a5008c99b7d2ff947340ba89d85be72375 /src | |
parent | db6e7e6f97d03f4857fc4dd70362290e546c0cdf (diff) |
fix: character entity parsing
Diffstat (limited to 'src')
-rw-r--r-- | src/HTML5/Parser/Tokenizer.php | 11 |
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 '&'; } } |