Comments in Jade/pug

Randomblue picture Randomblue · Dec 16, 2011 · Viewed 45.5k times · Source

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

doctype html

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

What am I doing something stupid?

Answer

alessioalex picture alessioalex · Dec 17, 2011

As written in the comment documentation, you can either use // which will translate to a HTML comment or //- which won't be visible in the outputted HTML code.