Bug in HTML validator

Anony Mous <[email protected]> Wed, 10 Jun 2020 12:13:15 -0600
Newsgroups gmane.org.w3c.validator
Message-ID <CANv=BrrTz6ZQ3K+kL5yC5KdgAW=okbGto28hHh8B2SQKfjYwOQ@mail.gmail.com>
--000000000000c28e8505a7becd4d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Validator reports this problem:

Bug indication:

 *Line 32
<https://validator.w3.org/check?uri=3Dhttp%3A%2F%2Fourtimelines.com%2Fsides=
ystems%2Ffiltcapcalc.html&charset=3D%28detect+automatically%29&doctype=3DIn=
line&ss=3D1&group=3D0&accept=3Dtext%2Fhtml%2Capplication%2Fxhtml%2Bxml%2Cap=
plication%2Fxml%3Bq%3D0.9%2C*%2F*%3Bq%3D0.8&accept-language=3Den-us&user-ag=
ent=3DW3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices#line-32>=
,
Column 115*: end tag for element "FONT" which is not open

=E2=80=A6ntById("result").innerHTML =3D "<font color=3D\"#ff0000\">Error</f=
ont>";  return; }

=E2=9C=89
<https://validator.w3.org/feedback.html?uri=3Dhttp%3A%2F%2Fourtimelines.com=
%2Fsidesystems%2Ffiltcapcalc.html;errmsg_id=3D79#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 =
=3D
   "<font color=3D\"#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=3D"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.

--000000000000c28e8505a7becd4d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div cl=
ass=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,monospac=
e;font-size:small;color:rgb(0,0,0)">Validator reports this problem:</div><d=
iv class=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,mon=
ospace;font-size:small;color:rgb(0,0,0)"><br></div><div class=3D"gmail_defa=
ult" style=3D"font-family:&quot;courier new&quot;,monospace;font-size:small=
;color:rgb(0,0,0)"><span style=3D"font-family:Helvetica;font-size:12px">Bug=
 indication:</span><div style=3D"font-family:Helvetica;font-size:12px"><br>=
</div><div style=3D"font-family:Helvetica;font-size:12px"><span class=3D"er=
r_type" style=3D"background-color:rgb(252,252,252);color:rgb(31,33,38);font=
-family:Helvetica,Arial,sans-serif;font-size:16px"></span><span style=3D"co=
lor:rgb(31,33,38);font-family:Helvetica,Arial,sans-serif;font-size:16px;bac=
kground-color:rgb(252,252,252)">=C2=A0</span><em style=3D"background-color:=
rgb(252,252,252);color:rgb(31,33,38);font-family:Helvetica,Arial,sans-serif=
;font-size:16px">Line=C2=A0<a href=3D"https://validator.w3.org/check?uri=3D=
http%3A%2F%2Fourtimelines.com%2Fsidesystems%2Ffiltcapcalc.html&amp;charset=
=3D%28detect+automatically%29&amp;doctype=3DInline&amp;ss=3D1&amp;group=3D0=
&amp;accept=3Dtext%2Fhtml%2Capplication%2Fxhtml%2Bxml%2Capplication%2Fxml%3=
Bq%3D0.9%2C*%2F*%3Bq%3D0.8&amp;accept-language=3Den-us&amp;user-agent=3DW3C=
_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices#line-32" style=3D=
"margin:0px;padding:0px;border:0px;font-style:normal;vertical-align:baselin=
e;color:rgb(54,93,149);line-height:1">32</a>, Column 115</em><span style=3D=
"color:rgb(31,33,38);font-family:Helvetica,Arial,sans-serif;font-size:16px;=
background-color:rgb(252,252,252)">:=C2=A0</span><span class=3D"gmail-msg" =
style=3D"font-weight:bold;line-height:20.799999237060547px;background-color=
:rgb(252,252,252);color:rgb(31,33,38);font-family:Helvetica,Arial,sans-seri=
f;font-size:16px">end tag for element &quot;FONT&quot; which is not open</s=
pan><span style=3D"color:rgb(31,33,38);font-family:Helvetica,Arial,sans-ser=
if;font-size:16px;background-color:rgb(252,252,252)"></span><pre style=3D"b=
ackground-color:rgb(252,252,252);color:rgb(31,33,38)"><code class=3D"gmail-=
input" style=3D"color:black;font-family:&quot;Bitstream Vera Sans Mono&quot=
;,monospace;font-size:small;margin-bottom:2ex">=E2=80=A6ntById(&quot;result=
&quot;).innerHTML =3D &quot;&lt;font color=3D\&quot;#ff0000\&quot;&gt;Error=
&lt;/font<span title=3D"Position where error was detected." style=3D"margin=
:0px;padding:0px 0.5ex;border-width:0px 0px thin;border-bottom-style:dotted=
;font-size:13px;font-family:Helvetica,Arial,sans-serif;vertical-align:basel=
ine;color:red;line-height:1">&gt;</span>&quot;;  return; }</code></pre><div=
 style=3D"margin:0px 0px 0.65em;padding:0px;border:0px;font-weight:bold;fon=
t-size:16px;font-family:Helvetica,Arial,sans-serif;vertical-align:baseline;=
background-color:rgb(252,252,252);color:rgb(136,136,136);line-height:21.600=
000381469727px;float:right;width:20px"><a href=3D"https://validator.w3.org/=
feedback.html?uri=3Dhttp%3A%2F%2Fourtimelines.com%2Fsidesystems%2Ffiltcapca=
lc.html;errmsg_id=3D79#errormsg" title=3D"Suggest improvements on this erro=
r message through our feedback channels" style=3D"margin:0px;padding:0px;bo=
rder:0px;font-weight:normal;vertical-align:baseline;color:rgb(136,136,255);=
line-height:1;text-decoration:none">=E2=9C=89</a></div><div class=3D"gmail-=
ve gmail-mid-79" style=3D"margin:0px;padding:0px;border:0px;font-size:small=
er;font-family:Helvetica,Arial,sans-serif;vertical-align:baseline;backgroun=
d-color:rgb(252,252,252);color:rgb(31,33,38);line-height:1;width:1136px"><p=
 style=3D"margin:1ex 5em 0.65em 1em;padding:0px;border:0px;font-size:13.333=
332061767578px;vertical-align:baseline;line-height:17.999998092651367px;tex=
t-align:justify">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 cl=
osed element (if you have an error related to an element being used where i=
t is not allowed, this is almost certainly the case). In the latter case th=
is error will disappear as soon as you fix the original problem.</p></div><=
/div></div><div class=3D"gmail_default" style=3D"font-family:&quot;courier =
new&quot;,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div class=
=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,monospace;f=
ont-size:small;color:rgb(0,0,0)">Here&#39;s the line from within &lt;script=
&gt;&lt;/script&gt; tags:</div><div class=3D"gmail_default" style=3D"font-f=
amily:&quot;courier new&quot;,monospace;font-size:small;color:rgb(0,0,0)"><=
br></div><div class=3D"gmail_default" style=3D"font-family:&quot;courier ne=
w&quot;,monospace;font-size:small;color:rgb(0,0,0)"><ol class=3D"gmail-sour=
ce" style=3D"margin:1em 0px 0px;padding:0px;border:1px solid black;font-siz=
e:smaller;font-family:&quot;Bitstream Vera Sans Mono&quot;,monospace;vertic=
al-align:baseline;background-color:rgb(234,235,238);color:rgb(31,33,38);lin=
e-height:1;list-style-position:inside"><li id=3D"gmail-line-32" style=3D"ma=
rgin:0.5em 1em;padding:0px;border:0px;font-size:13.333332061767578px;font-f=
amily:Helvetica,Arial,sans-serif;vertical-align:baseline;line-height:19.999=
998092651367px;text-align:left">if (isNaN(vlinefreq)) { document.getElement=
ById(&quot;result&quot;).innerHTML =3D &quot;&lt;font color=3D\&quot;#ff000=
0\&quot;&gt;Error&lt;/font&gt;&quot;; return; }</li></ol></div><div class=
=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,monospace;f=
ont-size:small;color:rgb(0,0,0)"><br></div><div class=3D"gmail_default" sty=
le=3D"font-family:&quot;courier new&quot;,monospace;font-size:small;color:r=
gb(0,0,0)">...as can be seen, the tags are within a quoted string inside a =
script, and they are both present and correct.</div><div class=3D"gmail_def=
ault" style=3D"font-family:&quot;courier new&quot;,monospace;font-size:smal=
l;color:rgb(0,0,0)"><br></div><div class=3D"gmail_default" style=3D"font-fa=
mily:&quot;courier new&quot;,monospace;font-size:small;color:rgb(0,0,0)">Th=
e 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 i=
sn&#39;t. It shouldn&#39;t be treated that way.</div><div class=3D"gmail_de=
fault" style=3D"font-family:&quot;courier new&quot;,monospace;font-size:sma=
ll;color:rgb(0,0,0)"><br></div><div class=3D"gmail_default" style=3D"font-f=
amily:&quot;courier new&quot;,monospace;font-size:small;color:rgb(0,0,0)">A=
lso, the script opening tag correctly calls out the script type...</div><di=
v class=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,mono=
space;font-size:small;color:rgb(0,0,0)"><br></div><div class=3D"gmail_defau=
lt" style=3D"font-family:&quot;courier new&quot;,monospace;font-size:small;=
color:rgb(0,0,0)"><span style=3D"color:rgb(31,33,38);font-family:Helvetica,=
Arial,sans-serif;font-size:13.333332061767578px;background-color:rgb(234,23=
5,238)">script type=3D&quot;text/javascript&quot;</span><br></div><div clas=
s=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,monospace;=
font-size:small;color:rgb(0,0,0)"><br></div><div class=3D"gmail_default" st=
yle=3D"font-family:&quot;courier new&quot;,monospace;font-size:small;color:=
rgb(0,0,0)">..so there i&#39;s a clear indication to the validator of the c=
ontext.</div><div class=3D"gmail_default" style=3D"font-family:&quot;courie=
r new&quot;,monospace;font-size:small;color:rgb(0,0,0)"><br></div><div clas=
s=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,monospace;=
font-size:small;color:rgb(0,0,0)">Either:</div><div class=3D"gmail_default"=
 style=3D"font-family:&quot;courier new&quot;,monospace;font-size:small;col=
or:rgb(0,0,0)"><br></div><div class=3D"gmail_default" style=3D"font-family:=
&quot;courier new&quot;,monospace;font-size:small;color:rgb(0,0,0)">A -- it=
 should not try to parse HTML within &lt;SCRIPT&gt;&lt;/SCRIPT&gt;</div><di=
v class=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,mono=
space;font-size:small;color:rgb(0,0,0)">B -- it needs to understand that \&=
quot; within &quot;&quot; is not a valid &quot;</div><div class=3D"gmail_de=
fault" style=3D"font-family:&quot;courier new&quot;,monospace;font-size:sma=
ll;color:rgb(0,0,0)"><br></div><div class=3D"gmail_default" style=3D"font-f=
amily:&quot;courier new&quot;,monospace;font-size:small;color:rgb(0,0,0)">.=
...probably A.</div><div class=3D"gmail_default" style=3D"font-family:&quot;=
courier new&quot;,monospace;font-size:small;color:rgb(0,0,0)"><br></div><di=
v class=3D"gmail_default" style=3D"font-family:&quot;courier new&quot;,mono=
space;font-size:small;color:rgb(0,0,0)"><br></div><div class=3D"gmail_defau=
lt" style=3D"font-family:&quot;courier new&quot;,monospace;font-size:small;=
color:rgb(0,0,0)"><br></div></div></div></div></div>

--000000000000c28e8505a7becd4d--