Michael said:
I don't know where you read that, and you could well be right, but it
seems odd to me.
<
http://www.w3.org/MarkUp/html-spec/html-spec_3.html#SEC3.2.5>
<quote>
To include comments in an HTML document, use a comment declaration.
A comment declaration consists of `<!' followed by zero or more
comments followed by `>'.
Each comment starts with `--' and includes all text up to and including
the next occurrence of `--'.
In a comment declaration, white space is allowed after each comment,
but not before the first comment.
The entire comment declaration is ignored.
I recently came across a Microsoft document that contained
something like:
<!------->
and Firefox promptly ignored everything after that until it came across
something similar later.
Uuhm.... What Firefox did you use? Firefox 1.5 DOM Inspector shows
correctly #comment node with value "---" (should be "-----" including
the closing comment block mark - see above).
Truthfully I don't understand why anyone would try to insert "--" into
comment block. One cannot use "<" inside tag and no big deal but
impossibility to use "--" makes people all upset
In any case, it is undoubtely safer to take the XML approach: comments
start with '<!--', end with '-->' ('--->' is forbidden), and should
never include paired hyphens ('--').
There is not XML approach: there is SGML approach common for both HTML
and XML and commonly half-a** implemented by everyone including Her
holly standard crazyness Amaya.
You use <!> tag, start comment block with "--" where the first block
declaration has to be immediately after the tag name: <!-- and ends up
and includes the closing declaration.
Therefore <!-- Comment 1-- -- Comment 2-- -- Comment 3--
id="myComment"> in any SGML-based subset should produce three comment
blocks
Comment 1--
Comment 2--
Comment 3--
and named attribute "id" (comments are allowed to have attributes btw -
but because of broken implementation one cannot use this ability).
All this question is not really important for practical development. It
is enough to remember the "explanation shortcut": comment tag starts
with <!-- and ends with -->
This "explanation shortcut" is wrong from the first to the last word,
but it's easy to remember and it guarantees the oops protection.
But if one decided to have a profound evangelism discussion, let's talk
to the last dot over "i".