在Slim模板中,单独行上的HTML注释呈现在同一行上

时间:2014-01-14 19:56:40

标签: ruby templates slim-lang

在SLIM中编写HTML注释时:

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

输出变为

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

所有其他生成的HTML格式正确并缩进,因为我将pretty设置为true

我正在为其他人编写模板,所以我需要带有换行符的注释以便于阅读。

1 个答案:

答案 0 :(得分:14)

您可以在Slim中实现单个多行注释,如下所示:

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

哪个应输出:

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