Re: HTML: Comments

Earl Hood (ehood@imagine.convex.com)
Sun, 07 Aug 94 11:19:27 CDT


Message-Id: <199408071619.LAA23371@imagine.convex.com>
To: jv@nl.net
Cc: Multiple recipients of list <www-html@www0.cern.ch>
Subject: Re: HTML: Comments 
In-Reply-To: Your message of "Sun, 07 Aug 94 09:45:50 +0200."
             <m0qX2vE-0001XuC@squirrel.NL.net> 
Date: Sun, 07 Aug 94 11:19:27 CDT
From: Earl Hood <ehood@imagine.convex.com>

> 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