This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2880 - Incorrectly finds errors inside Javascript string constants
Summary: Incorrectly finds errors inside Javascript string constants
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.7.1
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
Depends on:
Reported: 2006-02-15 10:30 UTC by Matt Daly
Modified: 2006-02-15 11:45 UTC (History)
0 users

See Also:


Description Matt Daly 2006-02-15 10:30:59 UTC
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">
<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>";
No content, just testing validator
Comment 1 Matt Daly 2006-02-15 11:45:41 UTC
Sorry, found details excusing the problem in the faq. It still seems wrong to 
me though...