W3C home > Mailing lists > Public > www-validator@w3.org > May 2008

HTML validator bug

From: Bob Miller <rmiller@generalcode.com>
Date: Thu, 8 May 2008 15:33:15 -0400
Message-ID: <A1439E2EAF75A44288DA223C948A63BE24C6B5@GCMAIL.generalcode.com>
To: <www-validator@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:29 GMT