slim: Deal with 'spaces around tags' problem

This issue is nicely visible in this stackoverflow question.

You have to put two spaces at the beginning of ' tag that appear after html tag to separate them with space. This is really annoying when adding many links to SLIM template, and sincerely one of the reasons why my team don’t want to switch from HAML.

Please deal with it one way or another.

I think a good solution is to redefine ' tag to add spaces before and after added text UNLESS it is first or last in group. So following:

EDIT: I don’t think this solution is good anymore. Please look at new one in this comment

p
  ' Please look
  a href="" here
  ' and 
  a comment 
  ' if you want

would render to:

<p>Please look <a>here</a> and <a>comment</a> if you want</p>

Following:

p
  'Please look
  a href="" here
  'and 
  a comment 
  'if you want

would render to:

<p>Please look <a>here</a>and <a>comment</a>if you want </p>

And following:

p
  |  Please look
  a href="" here
  |  and 
  a comment 
  |  if you want

would render to:

<p> Please look<a>here</a> and<a>comment</a> if you want</p>

I hope it is not too late. Please consider this issue seriously.

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 233 (121 by maintainers)

Commits related to this issue

Most upvoted comments

What’s the problem with smart mode’s

label
  > Notify me
  select
    option daily
    option weekly
  > about the changes.

then?