diff --git a/lib/haml/engine.rb b/lib/haml/engine.rb index 6622f651de..bc90849e08 100644 --- a/lib/haml/engine.rb +++ b/lib/haml/engine.rb @@ -162,7 +162,7 @@ def _haml_render suppress_render = handle_multiline(old_tabs, old_line, old_index) - if !suppress_render && old_spaces + if !suppress_render line_empty = old_line.empty? process_indent(old_tabs, old_line) unless line_empty flat = @flat_spaces != -1 @@ -250,6 +250,7 @@ def mid_block_keyword?(line) # This returns whether or not the line should be # rendered normally. def handle_multiline(count, line, index) + suppress_render = false # Multilines are denoting by ending with a `|` (124) if is_multiline?(line) && @multiline_buffer # A multiline string is active, and is being continued @@ -264,9 +265,10 @@ def handle_multiline(count, line, index) suppress_render = true elsif @multiline_buffer # A multiline string has just ended, make line into the result - process_line(@multiline_buffer, @multiline_index, count > @multiline_count) - @multiline_buffer = nil - suppress_render = false + unless line.empty? + process_line(@multiline_buffer, @multiline_index, count > @multiline_count) + @multiline_buffer = nil + end end return suppress_render diff --git a/test/results/silent_script.xhtml b/test/results/silent_script.xhtml index 54bd069e35..e646942abe 100644 --- a/test/results/silent_script.xhtml +++ b/test/results/silent_script.xhtml @@ -69,4 +69,6 @@ 2 3 4 - +
+

boom

+
diff --git a/test/templates/silent_script.haml b/test/templates/silent_script.haml index 451f9de6c0..fc6efa0372 100644 --- a/test/templates/silent_script.haml +++ b/test/templates/silent_script.haml @@ -32,3 +32,9 @@ do | |a| | %strong= a +.test + - "foo | + bar | + baz" | + + %p boom