diff --git a/lib/haml/compiler.rb b/lib/haml/compiler.rb index 70f4a829..89e4d3d2 100644 --- a/lib/haml/compiler.rb +++ b/lib/haml/compiler.rb @@ -243,7 +243,7 @@ END push_merged_text("#{open} ") if @node.value[:parse] - push_script(@node.value[:text], :in_tag => true) + push_script(@node.value[:text], :in_tag => true, :nuke_inner_whitespace => true) else push_merged_text(@node.value[:text], 0, false) end diff --git a/test/engine_test.rb b/test/engine_test.rb index 116b11fb..c25dc985 100644 --- a/test/engine_test.rb +++ b/test/engine_test.rb @@ -1268,6 +1268,11 @@ HAML render('/ Hello #{1 + 1}', :suppress_eval => true)) end + def test_single_line_comments_with_interpolation_dont_break_tabulation + assert_equal("\nconcatted\n", + render("/ Hello \#{1 + 1}\n- haml_concat 'concatted'")) + end + def test_balanced_conditional_comments assert_equal("\n", render("/[if !(IE 6)|(IE 7)] Bracket: ]"))