【发布时间】:2017-09-06 18:55:12
【问题描述】:
在 HTML 中,我们通常做 cmets 类似:
<!-- Comment here -->
为什么评论不对称如下:
<!-- Comment here --!>
我正在寻找历史答案。
【问题讨论】:
在 HTML 中,我们通常做 cmets 类似:
<!-- Comment here -->
为什么评论不对称如下:
<!-- Comment here --!>
我正在寻找历史答案。
【问题讨论】:
请查看HTML 2.0 RFC 这是有趣的部分:
要在 HTML 文档中包含 cmets,请使用注释声明。一种 注释声明由
<!' followed by zero or more comments followed by>'组成。每条评论都以--' and includes all text up to and including the next occurrence of--' 开头。在一个 注释声明,每条注释后面可以有空格,但是 不是在第一条评论之前。整个评论声明是 忽略。
注意 - 一些历史 HTML 实现错误地考虑了 任何 `>' 字符作为注释的终止。
例如:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HEAD>
<TITLE>HTML Comment Example</TITLE>
<!-- Id: html-sgml.sgm,v 1.5 1995/05/26 21:29:50 connolly Exp -->
<!-- another -- -- comment -->
<!>
</HEAD>
<BODY>
<p> <!- not a comment, just regular old data characters ->
【讨论】: