W3C home > Mailing lists > Public > www-html@w3.org > April 2002

Re: Double hyphens ('--') in comments invalid

From: <news-misc@ada.dhs.org>
Date: Mon, 29 Apr 2002 02:53:05 GMT
Message-ID: <GvB6oI.7zE@ada.dhs.org>
To: www-html@w3.org
In article <>,
Greg Faron <gfaron@integretechpub.com> wrote:

>   I've been directed to the XML spec in which it states
>that "for compatibility, the string '--' (double-hyphen)
>must not occur within comments."  I assume it refers to the
>compatibility with SGML (of which I know very little).

No, it refers to compatibility with HTML, which, because web
browsers have been buggy w.r.t. comments since the beginning,
artificially limits the number of SGML comments that can be
placed inside any element to 1 comment, and which artificially
forbids comments to be placed in elements other than <!>.

In SGML, pairs of -- delimit a comment (i.e., --foo-- is a
comment for any foo that does not contain -- itself).

Ambrose Li  <acli@ada.dhs.org>   http://trends.ca/~acli/
A good style should show no sign of effort;
  what is written should seem a happy accident. - Somerset Maugham
Received on Tuesday, 30 April 2002 02:26:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:59 UTC