Comment (computer programming): Difference between revisions

Content deleted Content added
Examples: merge SQL into double dash section
Examples: Merge xml, html, coldfusion
Line 470:
"""Method docstring"""
</syntaxhighlight>
 
===Browser markup===
 
Markup languages in general vary in comment syntax, but some of the notable internet markup formats such as [[HTML]] and [[XML]] delimit a block comment with <code>&lt;!--</code> and <code>--&gt;</code> and provide no line comment support. An example in XML:
 
<syntaxhighlight lang="xml">
<!-- select the context here -->
<param name="context" value="public" />
</syntaxhighlight>
 
For compatibility with [[SGML]], double-hyphen (--) is not allowed inside comments.
 
[[ColdFusion]] provides syntax similar to the [[HTML comment]], but uses three dashes instead of two. CodeFusion allows for nested block comments.
 
===Double dash===
Line 620 ⟶ 633:
shut
exit
</syntaxhighlight>
 
====ColdFusion====
[[ColdFusion]] uses comments similar to [[HTML comment]]s, but instead of two dashes, it uses three. These comments are caught by the ColdFusion engine and not printed to the browser.
 
Such comments are nestable.
 
<syntaxhighlight lang="cfm">
<!--- This prints "Hello World" to the browser.
<!--- This is a comment used inside the first one.
--->
--->
<cfoutput>
Hello World<br />
</cfoutput>
</syntaxhighlight>
 
Line 748 ⟶ 746:
}
</syntaxhighlight>
 
====XML and HTML====
A block comment in [[XML]] and [[HTML]] is delimited by
<code>&lt;!--</code> and <code>--&gt;</code>. Line comment is not supported. For example,
 
<syntaxhighlight lang="xml">
<!-- select the context here -->
<param name="context" value="public" />
</syntaxhighlight>
 
For compatibility with [[SGML]], double-hyphen (--) is not allowed inside comments.
 
==Security issues==