Template::HAML supports three forms of comments: HTML comments, conditional comments, and silent comments.
A line beginning with / is rendered as an HTML comment.
Single-line form:
If the / line has children indented underneath, they are rendered inside the comment block:
Use /[expr] to emit a conditional comment. The bracketed text becomes the condition; surrounding whitespace is stripped.
Inline form:
| <!--[if IE]>text<![endif]-->
|
Block form:
| <!--[if IE]>
<p>ie only</p>
<![endif]-->
|
Negated:
| <!--[if !IE]>text<![endif]-->
|
Prefix the bracket with ! to emit a downlevel-revealed conditional comment. Browsers that don't honor the condition see the wrapped content as plain markup:
| <!--[if !IE]><!-->text<!--<![endif]-->
|
A line beginning with -# is suppressed entirely. Any indented body — including any number of blank lines — is treated as opaque text and produces no output:
| %p hi
-# notes:
arbitrary text $^&* not parsed as HAML
!!! also opaque
%p bye
|
Because the body is opaque, you can drop in non-HAML content (e.g. design notes, stale code, scratch markup) without provoking parse errors.