Issue in validator ?

According to validator, this document has a problem :

<!doctype html>
<html>
<head><title>title</title></head>
<body>
<script type="text/javascript">
var a = 1;
<!--comment in script with false </script> -->
var b = 2;
</script>
</body>
</html>

Error being :
"The text content of element script was not in the required format:
Content contains the character sequence <!-- without a later occurrence
of the character sequence -->."


According to your documentation
(https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements)
:

inner = < any string that doesn't contain a substring that matches
not-in-inner >

not-in-inner = comment-close / script-open

So, inside a comment inside a script tag I should not "open" a new
script tag. But nothing about closing one... Being into the comment tag,
parser should try to find a opening tag or a comment closing tag.


Where am I wrong ? ;o)

Regards,


-- 
Thomas Bouchet
Souris Maline
Tel: +33 (0)6 63 54 27 78
http://sourismaline.fr/

Received on Thursday, 3 September 2015 11:23:13 UTC