Comments on Jade / pug

I tried making comments in Jade / pug, but comments are displayed as text in HTML. This is my code:

doctype html html(lang='en') body / This should be a comment 

What am I doing something stupid?

+67
Dec 16 2018-11-12T00:
source share
2 answers

As written in the documentation, you can use // , which will translate into an HTML comment, or //- that won’t be displayed in the HTML output.

+147
Dec 16 '11 at 23:28
source share
β€” -

In jade we use // - for comments. If you are trying to comment on a block, make sure it must be indented correctly, as shown below -

 doctype html html(lang='en') body //- This should be a comment Indent correctly for block content 
+2
Dec 6 '16 at 6:58
source share



All Articles