Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a strange Haml indentation-error bug.

  • Loading branch information...
commit 534b536b6f0e42d8e8c3c1fd806161a61b15acb2 1 parent 429314d
@nex3 nex3 authored
View
10 lib/haml/precompiler.rb
@@ -119,11 +119,6 @@ def precompile
@next_line = line = Line.new(text.strip, text.lstrip.chomp, index)
line.spaces, line.tabs = count_soft_tabs(text)
- if line.text.empty? && !flat?
- newline
- next
- end
-
suppress_render = handle_multiline(old_line) unless flat?
if old_line.text.nil? || suppress_render
@@ -135,6 +130,11 @@ def precompile
process_indent(old_line) unless old_line.text.empty?
+ if line.text.empty? && !flat?
+ newline
+ next
+ end
+
if flat?
push_flat(old_line)
old_line = line
View
6 test/haml/results/just_stuff.xhtml
@@ -60,3 +60,9 @@ testtest
Woah inner quotes
<p class='dynamic_quote' dyn='3' quotes="single '"></p>
<p class='dynamic_self_closing' dyn='3' />
+<body>
+ hello
+ <div>
+ <img />
+ </div>
+</body>
View
7 test/haml/templates/just_stuff.haml
@@ -74,3 +74,10 @@
== #{"Woah inner quotes"}
%p.dynamic_quote{:quotes => "single '", :dyn => 1 + 2}
%p.dynamic_self_closing{:dyn => 1 + 2}/
+%body
+ :plain
+ hello
+ %div
+
+ %img
+
Please sign in to comment.
Something went wrong with that request. Please try again.