haml/html2haml — pull request #3 by snatchev (2012-06-12 19:11:42+00:00)
Title: fix for https://github.com/haml/haml/issues/486 - indentation issue on comments

I think I have fixed the cause of this bug.

What has happening was that erubis was stripping out the content of comments `<%# some comment %>` and passing `"\n"` to ERB#add_stmt. Haml's add_stmt would then perform all 3 appending operations:

https://github.com/haml/html2haml/blob/master/lib/html2haml/html/erb.rb#L62-64

This lead to a getting opened after the comment.