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

Ste*_*uan 6 ruby templates slim-lang

在SLIM中编写HTML注释时:

/! The first line of comments
/! The second line of comments
Run Code Online (Sandbox Code Playgroud)

输出变成了

<!-- The first line of comments --><!-- The second line of comments -->
Run Code Online (Sandbox Code Playgroud)

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

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

ben*_*phw 14

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

/!
  The first line of comments
  The second line of comments
Run Code Online (Sandbox Code Playgroud)

哪个应该输出这个:

<!-- The first line of comments
The second line of comments -->
Run Code Online (Sandbox Code Playgroud)