I work with Saedar. We dug through the HAML code and realized that the indentation is only happening when the 'Ugly' option is false. The issue is that it's trying to indent the multiline text so that it's pretty with the formatted HTML.
For example, if you have a single line text inside of a span you get:
<div>
<div>
<span>This is a single line... doesn't matter how long it is.</span>
</div>
</div>
But as soon as you start splitting lines, the text goes on its own and is indented to be pretty in the source:
<div>
<div>
<span>
This has multiple lines.
It's formatted to be pretty in the source code.
</span>
</div>
</div>
This causes the text to be indented on each paragraph in our case because on that element we have the text-wrap
CSS style set to pre-wrap
.
The solution we're going with is to set Haml::Template.options[:ugly] = true
in config/initializers/haml.rb
This changes turns all of the html indenting off like so:
<div>
<div>
<span>
This has multiple lines.
It's formatted to be pretty in the source code.
</span>
</div>
</div>