Closed
Description
The following html:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Missing semicolon</title>
</head>
<body>
<p>S&P500</p>
<p>&</p>
</body>
</html>
Produces 2 errors, each corresponding to the
lines
line 8 column 9 - Warning: unescaped & or unknown entity "&P500"
line 9 column 8 - Warning: entity "&" doesn't end in ';'
Browsers output an ampersand correctly in both cases. This behaviour is specified in the standard below:
missing-semicolon-after-character-reference | This error occurs if the parser encounters a character reference that is not terminated by a U+003B (;) code point. Usually the parser behaves as if character reference is terminated by the U+003B (;) code point; however, there are some ambiguous cases in which the parser includes subsequent code points in the character reference.
So tidy should output the 'entity doesn't end in ;' warning in both cases.
Regards.