Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 715
Steven Yuan Avatar asked Jan 14 '14 19:01

Steven Yuan


People also ask

What is Slim in html?

What's Slim? Slim is a page-templating language that minimizes markup and syntax. It removes most of the extra "programming-like" symbols from HTML so that your code looks cleaner. Slim also adds if-else statements, loops, includes, and more.

What is Ruby slim?

Slim is a fast, lightweight templating engine with support for Rails 3 and later. It has been heavily tested on all major ruby implementations.


1 Answers

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 -->
like image 160
benjaminjosephw Avatar answered Oct 27 '22 01:10

benjaminjosephw