Main Page Content
Cf Has Smart Comment Tags
ColdFusion's comment tags can be nested. This isn't documented in Allaire's CFDOCS, in fact the only reference to CF comments I could find is in Chapter 4 Quick Start to ColdFusion - Creating Simple Dynamic Pages --
Note the use of the comment convention used in ColdFusion pages: <!--- and --->. ColdFusion comments use a form similar to HTML comments, but with an additional hyphen.Well, this isn't exactly true unlessyou interpret the word "similar" loosely. Unlike CF comments,HTML comments are cannot be nested.For example, consider the following block of HTML
this is uncommented HTMLIf you have ever tried to comment out an entireblock of HTML like the above, you willhave quickly discovered that you can not just slap openingand closing comment tags around theblock --
<!-- this is a comment -->
this again is uncommented
<!-- this is another comment -->
finally, this too is uncommented
<!-- open my commentThe above will notgive the intended results, because the opening <!-- tagwill be matched by the first --> tag encountered, despite thefact that there was a nested <!-- between them.Cold Fusion comments, however, can be nested, and the following willgive the intended results --
this is uncommented
<!-- this is a comment -->
this again is uncommented
<!-- this is another comment -->
finally, this too is uncommented
close my comment -->
<!--- open my CF commentEverything between the<!---and --->is one large CF comment, and none of it will be passed tothe web server by Cold Fusion.Neat, eh?
this is uncommented
<!--- this is a CF comment --->
this again is uncommented
<!--- this is another CF comment --->
finally, this too is uncommented
close my CF comment --->