Re: Simple(?) question on obscure comments detail

Peter Flynn (pflynn@curia.ucc.ie)
20 Sep 1996 01:44:42 +0100


Date: 20 Sep 1996 01:44:42 +0100
From: Peter Flynn <pflynn@curia.ucc.ie>
Subject: Re: Simple(?) question on obscure comments detail
In-reply-to: <R0aQy4uYOp3G089yn@htmlhelp.com> (galactus@htmlhelp.com)
To: galactus@htmlhelp.com (ArnoudEngelfriet)
Cc: www-html@w3.org
Message-id: <199609200044.BAA29476@curia.ucc.ie>

   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--->

Yes.

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
   comment?

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.

///Peter