Code Formatting + Line Continuation in Slim

I have been studying Slim recently, and I was wondering if there is a way to format or decorate my code. I was afraid to use new lines (by pressing Enter), because it causes errors.

The reason I want to format it is because most of my code cannot correspond to a single line of a text editor, and it usually happens that it continues to the next line, which usually ends to be unreadable to me.

This is usually just one line:
li #{author.first_name} #{author.last_name} <a href="/">View</a><a href="/">Edit</a><a href="/">Delete</a>

Is there a way or character to indicate line continuation? I want the links to use the following line so that it is more readable for me.

+6
source share
2 answers

You can also use an attribute wrapper to fit multiple lines.

 div[id="#my-id" class="my-class" data-author="George Washington" data-date="2013-08-21"] 
+8
source

Your example can be broken into smaller parts:

 li =#{author.first_name} #{author.last_name} a href="/" View a href="/" Edit a href="/" Delete 
+4
source

All Articles