HTML comments--not specific enough

E. Stephen Mack (
Fri, 22 Aug 1997 19:36:04 -0700

Message-Id: <>
Date: Fri, 22 Aug 1997 19:36:04 -0700
From: "E. Stephen Mack" <>
Subject: HTML comments--not specific enough

The section of the HTML 4.0 draft that describes how comments
are used in HTML does not go into very much detail. [1]

In particular, it doesn't warn that there are SGML prohibitions
against using two dashes (--) inside an HTML comment.  Nor does it
warn in this section that many older browsers terminate a comment
at the first > character; instead, that warning is buried at the end
of the script section [2].  At least a cross-reference should be

The script section should furthermore warn that a JavaScript
decrement character may inadvertently end up illegally terminating
a comment used to hide a script, like this:

<SCRIPT TYPE="text/javascript">
  <!-- Hide script
     function decrement (var) {
       var --;
  // End hiding -->

Such a construction is certain to confuse a validator or other
user agent that is aware of the proper construction of SGML