HTML validator bug

The HTML validator incorrectly parses and attempts to validate the
contents of a comment.  Data in comments should be ignored except for
the string "-->".  An example script is attached and will reliably
generate errors.  There are similar issues with things that look like
html inside of script tags.

Validator url: http://validator.w3.org/#validate_by_input+with_options

 

Validated content: 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title>Test</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"
>

<!--

 

//--

 var testVar = "<p>foo</p>";

            //--

 

-->

 

 

</head>

 

<body>

<h1>Some Heading</h1>

</body>

</html>





******************************************************************************
Do you get frequent requests for copies of certain sections of your Code? We can reproduce chapters of your Code in handy pamphlet format - no minimum quantity required! Order yours today.

Received on Friday, 9 May 2008 10:55:37 UTC