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
- [Haml] Make inner whitespace nuke consistent with loops. #465 %ul< - for str in %w[foo bar baz] = str <ul>foobarbaz</ul> — committed to richardkmichael/haml by richardkmichael 12 years ago
- Make inner whitespace nuke consistent with loops. %ul< - for str in %w[foo bar baz] = str <ul>foobarbaz</ul> See #465 for discussion. Closes #489. Signed-off-by: Norman Clarke <norman@njclar... — committed to haml/haml by richardkmichael 12 years ago
- Test for inner whitespace removal in loops See: #465 — committed to haml/haml by norman 12 years ago
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.