Re: Bugreport on comments

Harald Joerg (Harald.Joerg@mch.sni.de)
Thu, 04 Dec 1997 09:00:48 +0100


hellmuth@ira.uka.de wrote:
> I stumbled on the following bug in Parser.pm ( at least up to libwww-5.16
> which is current AFAIK). Comments with -- in the comment-text are not
> parsed correctly because -- (without the ending '>') is parsed as
> end-of-comment.

I would strongly recommend *not* to change the behaviour of
the parser. <!-- ------- --> is a syntactically wrong comment.
It was always, though this fact keeps being ignored by web authors
who claim that "Netscape displays it correct".
   Let me quote from the HTML 4.0 specification:
"White space is not permitted between the markup declaration
open delimiter("<!") and the comment open delimiter ("--"), 
but is permitted between the comment close delimiter ("--") 
and the markup declaration close delimiter (">").
A common error is to include a string of hyphens ("---")
within a comment. Authors should avoid putting two or more
adjacent hyphens inside comments."

> [...]
> $chunk= 'text bla  <!-- ------- --> more text bla';
--
Oook,
--haj--