Block comments in Pug (Jade)?

pug
sidonaldson picture sidonaldson · Dec 10, 2013 · Viewed 19.4k times · Source

How do you block comment out code in the Pug templating engine?

I know how to comment out a line:

//-doesn't show

but I don't want to have to write in full html comments like so:

<!--
    no show
-->

Answer

Dan Armstrong picture Dan Armstrong · Dec 10, 2013
//-
    Just indent the comment
    like normal elements

Just indent your comment like you do other elements.

Just be careful that you have your indention correct or you may comment out more than you intended.