File: comments.html

package info (click to toggle)
xmhtml 1.1.10-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,296 kB
  • sloc: ansic: 70,372; makefile: 480; sh: 176; perl: 36
file content (97 lines) | stat: -rw-r--r-- 2,548 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<html>
<body>
<h1>Removing HTML comments</h1>

Be sure the <b><font face="fixed">XmNenableBadHTMLWarnings</font></b> resource 
is set to <b>True</b> before loading this document.<p>
This document should generate three warnings: one for line 37, one for line
53 and one for line 65.
<p>

First of all, this is the basic definition of a SGML comment (and since HTML
is an SGML application, it is also the definition of a HTML comment):
<blockquote><p>
	A <i>comment declaration</i> starts with &lt;!, followed by zero or more
	comments, followed by &gt;. A comment starts and ends with "--", and does
	not contain any occurrence of "--". 
</blockquote><p>

Note that an "empty" comment tag, with just "--" characters, should always
have a multiple of four "-" characters to be legal. (And yes, &lt;!&gt; is
also a legal comment - it's the empty comment). 

<p></p><hr><p>

<!>
<tt>&lt;!&gt; the empty comment (zero dashes)</tt>
<p></p><hr><p>

<!-- standard comment --> 
<tt>&lt;!-- standard comment (four dashes) --&gt;</tt>
<p></p><hr><p>

<!-- text -- comment -- end -->
<tt>&lt;!-- text -- comment -- end (8 dashes) --&gt;</tt>
<p></p><hr><p>

<!-- this is a bad comment -- you see? -->
<tt>&lt;!-- this is a bad comment -- you see? (6 dashes) --&gt;</tt>
<p></p><hr><p>

<!--
	a comment spanning multiple lines --
	and it's a correct comment as well --
-->
<pre>
&lt;!--
	a comment spanning multiple lines --
	and it's a correct comment as well (8 dashes) --
--&gt;
</pre>
<p></p><hr><p>

<!--
	a comment spanning multiple lines --
	-- and it's a bad one --
-->
<pre>
&lt;!--
	a comment spanning multiple lines --
	-- and it's a bad one (10 dashes) --
--&gt;
</pre>
<p></p><hr><p>

<!---------------- International Sales Offices ---------------------->
<pre>
&lt;!---------------- International Sales Offices ----------------------&gt;<br>
(bad comment, 38 dashes)
</pre>
(saillant detail: this comment comes straight from a Netscape document...)<br>
<p></p><hr><p>

<!----<-->
	a nested comment (8 dashes) -->
<pre>
&lt;!----&lt;--&gt;
	a nested comment (8 dashes) --&gt;
</pre>
(most browsers I know of get the above comment wrong: the <i>a nested ...</i>
will appear twice in them)
<p></p><hr><p>

<!------> hello-->
<pre>
&lt;!------&gt; hello--&gt;
</pre>
(again, most browsers will also get this one wrong: the <i>hello--&gt;</i>
will appear twice)
<p></p><hr><p>

<!-- a comment - with dashes in between - (4 dashes and *not* 6) -->
<pre>
&lt;!-- a comment - with dashes in between - (4 dashes and *not* 6) --&gt;
</pre>

</body>
</html>