Skip to content

Commit 4f240ec

Browse files
committed
fix: character entity parsing
1 parent db6e7e6 commit 4f240ec

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/HTML5/Parser/Tokenizer.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,16 +1181,11 @@ protected function decodeCharacterReference($inAttribute = false)
11811181
return $entity;
11821182
}
11831183

1184-
// If in an attribute, then failing to match ; means unconsume the
1185-
// entire string. Otherwise, failure to match is an error.
1186-
if ($inAttribute) {
1187-
$this->scanner->unconsume($this->scanner->position() - $start);
1188-
1189-
return '&';
1190-
}
1184+
// Failing to match ; means unconsume the entire string.
1185+
$this->scanner->unconsume($this->scanner->position() - $start);
11911186

11921187
$this->parseError('Expected &ENTITY;, got &ENTITY%s (no trailing ;) ', $tok);
11931188

1194-
return '&' . $entity;
1189+
return '&';
11951190
}
11961191
}

0 commit comments

Comments
 (0)