haml: Inner whitespace nuke is inconsistent with loops

%ul<
  = "foo"
  = "bar"
  = "baz"

produces

<ul>foobarbaz</ul>

but

%ul<
  - for str in %w[foo bar baz]
    = str

produces

<ul>foo
bar
baz</ul>

About this issue

  • Original URL
  • State: closed
  • Created 13 years ago
  • Reactions: 1
  • Comments: 21 (9 by maintainers)

Commits related to this issue

Most upvoted comments

While quirkiness in output isn’t ideal– especially when we are doing formatting output, I believe that this issue is moot.

When Haml was first created, beautiful output was one of our major goals, because at the time we didn’t have good Inspectors in browsers. Now, it’s extremely easy to browse even the most gnarled spacing in HTML during development. The “beautiful” output just doesn’t have the utility it once had.

One extra space in this mode isn’t worth hardly any computational power today.

Going forward, I’d expect us to “corrupt” the beautiful output when given the option if it gains us anything.