Re: Hyphens in comments

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 UTC