Re: HTML: Comments

> My $.02 --
> 
> HTML could use a decent way to include comments. The current way,
> using '<!-- ... -->' is very tedious and any '>' in the comment will
> cause the comment to be terminated. No easy way to 'comment out' a
> piece of HTML code.

The <!-- ... --> is a comment declaration in SGML, and is able to span
multiple lines.  The limitation you are complaining about is due to the
limitations in browsers to properly parse comment declarations.

A comment declaration is only terminated when the sequence "-->" occurs
(whitespace is allowed between the "--" and ">").  Therefore, you
can (should be able to) comment HTML markup; e.g.

	<!--
		<h2>Commented out head 2</h2>
		Commented out text.
		<p>
	  -->

But until browsers do things properly, you are limited to the "tedious"
way.

	--ewh

Received on Sunday, 7 August 1994 18:21:36 UTC