Comments
GoHT supports two types of comments. Comments that will be left in the rendered HTML and comments that will be removed from the rendered HTML.
HTML Comments
HTML comments are comments that will be left in the rendered HTML. They are created by using the forward slash /
character.
%p Now you see me
/ and now you don't
renders as:
<p>Now you see me</p>
<!-- and now you don't -->
Haml Comments
Haml comments are comments that will be removed from the rendered HTML. They are created by using a dash and a pound -#
character combination.
%p Now you see me
-# and now you don't
renders as:
<p>Now you see me</p>
These types of comments are stripped out and will not become part of the generated Go code.
Nesting
Both kinds of comments can be used to comment out multiple lines of content.
%p Now you see me
/
and now you don't
%p Now you see me
-#
%p and now you don't
renders as:
<p>Now you see me</p>
<!--
and now you don't
-->
<p>Now you see me</p>
Conditional Comments
Conditional comments are a feature of Internet Explorer in versions prior to IE 10. They are used to include or exclude content from the page based on the version of Internet Explorer that is being used. They are not part of the HTML5 specification and are not supported by GoHT.