Comments
Comments in Jade are marked using double slashes (//
) or double slashes with a trailing hyphen (//-
). The former comments show up in the HTML as HTML comments, while the latter remain in the view file and are not rendered in the HTML.
Tags nested within a comment will either be commented in the HTML or not be rendered at all, depending on the comment type.
Here are some examples to help you understand how comments work in Jade:
Jade |
HTML |
---|---|
// Here is a comment p Howdy?
|
<!-- Here is a comment--> <p>Howdy?</p>
|
//- This comment will not be shown in the HTML p Something interesting
|
<p>Something interesting</p>
|
// p This paragraph will be commented out
|
<!-- <p>This paragraph will be commented out</p> -->
|
//- p This paragraph won't even show up in the HTML
|
Jade even supports Internet Explorer's conditional comments:
// if lt 8 script alert('Upgrade your browser!');
will render:
<!--[if lt 8]> <script...