标准模式 HTML forbids double hyphens在评论中。
<!-- This is a perfectly valid comment - I think. -->
<!-- Invalid comment -- definitely. -->
还有三个额外的限制,以这些无效示例为例:
<!--> invalid -->
<!---> invalid -->
<!-- invalid --->
为什么要费心指定所有这些小的边缘情况?特别是,为什么禁止使用双连字符?
[Definition: Comments may appear anywhere in a document outside other
markup; in addition, they may appear within the document type
declaration at places allowed by the grammar. They are not part of the
document's character data; an XML processor may, but need not, make it
possible for an application to retrieve the text of comments. For
compatibility, the string " -- " (double-hyphen) must not occur within
comments.] Parameter entity references must not be recognized within
comments.
语法不允许以--->结尾的注释
它似乎是 XML 的一个特性,只是为了确保 XML 与 SGML 保持兼容
http://www.w3.org/TR/REC-xml/#sec-comments