Re: Comments in HTML

murray@spyglass.com (Murray Altheim) write:
> >>Stewart Brodie <S.N.Brodie@ecs.soton.ac.uk> writes:
> >>>The problem is that browsers have to terminate comments at the first '>'
> >>>beacuse, IIRC, a very early draft of the HTML 2 documentation contained a
> >>>misprint and browser authors accepted any > to terminate a comment . . .
> 
> I don't know why *anyone* would attempt to support broken behavior from a
> misprint in a really outdated draft. 
 
> Most current browsers (Spyglass Mosaic, MSIE, Netscape, NCSA Mosaic, etc.)
> handle comments rather accurately according to this specification, with a
> few exceptions.

I have just checked out a copy of Netscape 2 on the Mac and its
behaviour is quite interesting.

When it has received the sequence <!-- it then looks for the closing
-->. If it finds it then all works OK. If it doesn't find it in the rest
of the document then it backtracks and takes the first occurence of > to
be the close of the comment.

Whilst this is quite clever defensive code it does mean that anyone
who writes their pages always using  <!-- ... > to delimit quotes will
have their pages carrying on working and so be unresponsive to requests
to fix it.

Simon Middleton.

Received on Wednesday, 12 June 1996 13:07:34 UTC