summaryrefslogtreecommitdiff
path: root/src/HTML5/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/HTML5/Parser')
-rw-r--r--src/HTML5/Parser/Tokenizer.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/HTML5/Parser/Tokenizer.php b/src/HTML5/Parser/Tokenizer.php
index e00b9a2..a779191 100644
--- a/src/HTML5/Parser/Tokenizer.php
+++ b/src/HTML5/Parser/Tokenizer.php
@@ -1065,8 +1065,14 @@ class Tokenizer
// [a-zA-Z0-9]+;
$cname = $this->scanner->getAsciiAlpha();
$entity = CharacterReference::lookupName($cname);
+
+ // When no entity is found provide the name of the unmatched string
+ // and continue on as the & is not part of an entity. The & will
+ // be converted to & elsewhere.
if ($entity == null) {
- $this->parseError("No match in entity table for '%s'", $entity);
+ $this->parseError("No match in entity table for '%s'", $cname);
+ $this->scanner->unconsume($this->scanner->position() - $start);
+ return '&';
}
}