firefox rendering and validation bug?

Earlier this week I was testing a site and noticed some weird extra characters being displayed in the page, I checked the html source to see where they were coming from. the characters being displayed were:

-->

ah! easy that’s just an end html comment, I must have left in by accident, but when i checked the source it was not the case, there were no end comment tags that had not been opened by the appropriate begin comment tag. On closer inspection I did notice something funny:

<!--
<tr>
<td>Phone:</td>
<td>--</td>
</tr>
<tr>
<td>Email:</td>
<td> </td>

</tr>
-->

it turns out that the two minus characters were actually ending the html comment, and so the actual end comment tag was seen as extraneous. I thought that was pretty odd, so i checked how things rendered in opera 9.5 - looked fine, IE 7 - looked fine, so then I tried the w3c validator to see if there was anything invalid about having two minus characters inside of an html comment. The validator complained about them - bitterly, so who’s right here? is this merely a parsing bug in the w3c’s validator and the firefox renderer, or are Microsoft and Opera wrong for hiding my mistake?

2 Responses to “firefox rendering and validation bug?”

  1. BigBadaboom Says:

    This is an SGML related thing. The following page offers a good explanation.

    http://www.howtocreate.co.uk/SGMLComments.html

    The short answer is that technically IE and Opera are incorrect.

  2. luke Says:

    thanks BigBadaboom, i knew HTML had it’s roots in SGML, so that link was very interesting reading :)

Leave a Reply