In Slim templates, HTML comments on separate lines are rendered on the same line

Steven Yuan picture Steven Yuan · Jan 14, 2014 · Viewed 9.6k times · Source

When writing HTML comments in SLIM:

/! The first line of comments
/! The second line of comments

The output becomes

<!-- The first line of comments --><!-- The second line of comments -->

All the other generated HTML is properly formatted and indented because I set pretty equal to true

I'm writing templates for other people to use so I need comments with line breaks for readability.

Answer

benjaminjosephw picture benjaminjosephw · Jan 14, 2014

You can achieve a single multi-line comment in Slim like this:

/!
  The first line of comments
  The second line of comments

Which should output this:

<!-- The first line of comments
The second line of comments -->