Bug in HTML validator

Validator reports this problem:

Bug indication:

 *Line 32
<https://validator.w3.org/check?uri=http%3A%2F%2Fourtimelines.com%2Fsidesystems%2Ffiltcapcalc.html&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0&accept=text%2Fhtml%2Capplication%2Fxhtml%2Bxml%2Capplication%2Fxml%3Bq%3D0.9%2C*%2F*%3Bq%3D0.8&accept-language=en-us&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices#line-32>,
Column 115*: end tag for element "FONT" which is not open

…ntById("result").innerHTML = "<font color=\"#ff0000\">Error</font>";  return; }

✉
<https://validator.w3.org/feedback.html?uri=http%3A%2F%2Fourtimelines.com%2Fsidesystems%2Ffiltcapcalc.html;errmsg_id=79#errormsg>

The Validator found an end tag for the above element, but that element is
not currently open. This is often caused by a leftover end tag from an
element that was removed during editing, or by an implicitly closed element
(if you have an error related to an element being used where it is not
allowed, this is almost certainly the case). In the latter case this error
will disappear as soon as you fix the original problem.

Here's the line from within <script></script> tags:


   1. if (isNaN(vlinefreq)) { document.getElementById("result").innerHTML =
   "<font color=\"#ff0000\">Error</font>"; return; }


....as can be seen, the tags are within a quoted string inside a script, and
they are both present and correct.

The validator (probably) does not understand that it is reading a script,
and it is trying to parse the script content as if it were straight HTML.
It isn't. It shouldn't be treated that way.

Also, the script opening tag correctly calls out the script type...

script type="text/javascript"

...so there i's a clear indication to the validator of the context.

Either:

A -- it should not try to parse HTML within <SCRIPT></SCRIPT>
B -- it needs to understand that \" within "" is not a valid "

....probably A.

Received on Friday, 12 June 2020 02:52:38 UTC