Add additional comment escaping patterns#162
Conversation
|
@whisk Do you mind reviewing this for me since you're familiar with it? I added in some additional items from the spec |
|
I've checked some comment variations with HTML5 validator and the older W3 validator. TL;DR
More detailsDouble dashes <!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Elem Page</title></head>
<body><p>Welcome to Elem!</p></body>
<!-- comment with -- in it -->
</html>
HTML 4.01 Strict also doesn't like The < character
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Elem Page</title></head>
<body><p>Welcome to Elem!</p></body>
<!-- comment with < in it -->
</html>XHTML 1.0 Strict and HTML 4.01 Strict also find Null character I believe null characters are explicitly not allowed in HTML, let alone comments: https://html.spec.whatwg.org/multipage/parsing.html#data-state
|
--(double dashes anywhere) →--\x00(null characters) →�<(in comments) →<