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

StackOverflow https://stackoverflow.com/questions/21122758

  •  28-09-2022
  •  | 
  •  

Вопрос

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.

Это было полезно?

Решение

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 -->
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top