False warning in HTML5 verifier

Hello, 

I generally find your verifier very useful.  However, it seems to have
problems with tags embedded within JavaScript.  It gave an invalid
warning saying a 4-column table row only had 3 elements because the 4th
column was declared within a document.write <script> section.  The code
was: 

<tr>
  <th colspan="3">Tax:
  <script>
    if (overpaid)
        document.write (' overpaid<\/th><td class="red">');
    else
        document.write (' due<\/th><td class="total">');
    var amount = 40.73;
    document.write ('&pound;' + amount + '<\/td>');
  </script>
</tr> 

As you can see, the <th> tag was closed and the 4th column <td> tags
were opened and closed within the script.  It seems to be happy that the
<th> tag was closed but didn't 'see' the <td> tags.  If I put the
closing </td> tag outside the script, it flagged an error citing a stray
</td> tag. 

Regards,
Steve Glennie-Smith

Received on Tuesday, 22 January 2019 08:27:15 UTC