Re: Simple(?) question on obscure comments detail

Peter Flynn (
20 Sep 1996 01:44:42 +0100

Date: 20 Sep 1996 01:44:42 +0100
From: Peter Flynn <>
Subject: Re: Simple(?) question on obscure comments detail
In-reply-to: <> (
To: (ArnoudEngelfriet)
Message-id: <>

   First tried to ask on www-talk, but unfortunately no one could offer
   an authoritative answer yet there..

   RFC 1866 defines an HTML comment tag as "<!" followed by 0 or more
   comments followed by ">". A comment is defined as "anything but
   the '--' sequence, enclosed in '--'". Now, is the following tag
   a valid comment?

   <!-- hello--->


The <! is a sequence which signals that what follows is a markup
_declaration_, not a piece of markup itself. It's what you use for
element and entity declarations in the writing of a DTD (read the HTML
DTD to see how). When followed by a comment enclosed in double
hyphens, it becomes a comment declaration. 

   Should a parser accept the first '-' of the three as part of the
   contents, or should it barf on the "->" stuff outside the first

What three? I count four hyphens in the example. A parser must accept
the example you have given as a valid comment, provided it is validly
located in the DTD or instance. There's nothing there to barf at.