Re: Comments in HTML

Simon Middleton (smiddleton@nc.acorn.co.uk)
Wed, 12 Jun 96 18:07:07 BST


Date: Wed, 12 Jun 96 18:07:07 BST
From: smiddleton@nc.acorn.co.uk (Simon Middleton)
To: www-html@w3.org
Subject: Re: Comments in HTML
Message-Id: <31BF074B@smiddleton>

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.