W3C home > Mailing lists > Public > www-validator@w3.org > March 2002

Re: Hyphens in comments

From: Christian Smith <csmith@barebones.com>
Date: Thu, 21 Mar 2002 07:05:43 -0500
To: www-validator@w3.org
cc: Olaf Buddenhagen <olafbuddenhagen@gmx.net>
Message-ID: <20020321070544-f01050004-0FB293FF-3C9A-11D6-B794-DD14470276F4-0922-010c@>
On 03/14/02 at 17:20, olafbuddenhagen@gmx.net (Olaf Buddenhagen) wrote:

> The HTML 4.01 standard says:
>    A common error is to include a string of hyphens ("---") within a
>    comment. Authors should avoid putting two or more adjacent hyphens
>    inside comments.
> (Section 3, "SGML and HTML)
> However, the validator doesn't complain about constructs like:
>    <!-------------->

I'm fairly certain that if you use that exact comment in an
HTML document the validator will complain since the comment
never terminates.

> in HTML mode. Now I wonder: *Is* that allowed, or is it not?...

It is allowed if you are careful and ensure that you use
multiples of 4 hyphens and only put content in between
matched pairs.

<---- --this is valid-- ---->

<----this is not---->
Received on Thursday, 21 March 2002 07:05:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:01 GMT