[Bug 2880] Incorrectly finds errors inside Javascript string constants

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2880

           Summary: Incorrectly finds errors inside Javascript string
                    constants
           Product: Validator
           Version: 0.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: check
        AssignedTo: link@pobox.com
        ReportedBy: mdaly@snapsurveys.com
         QAContact: www-validator-cvs@w3.org


If a web page contains JavaScript in which a string conatins Html like text, 
then errors can be incorrectly highlighted. Mainly seems to be strings shaped 
like closing tags which cause the error.
For exapmle, if you validate the Html listed below, the validator reports:
Error Line 7 column 43: end tag for element "H2" which is not open
But that tag is simply part of a string constant and is not html. Its certainly 
not invlaid.
I have done this both through file upload and direct input

here is the page to try:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test Validator</title>
<script language="JavaScript" type="text/javascript">
var aStringVariable = "<h2>just testing</h2>";
</script>
</head>
<body>
No content, just testing validator
</body>
</html>

Received on Wednesday, 15 February 2006 10:31:11 UTC