1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Fix another line-reporting bug in Haml.

This commit is contained in:
Nathan Weizenbaum 2008-05-02 00:48:39 -07:00
parent d77e383dc8
commit 1693be0bce
2 changed files with 4 additions and 1 deletions

View file

@ -139,6 +139,7 @@ END
if old_line.text.nil? || suppress_render
old_line = line
resolve_newlines
newline
next
end
@ -748,6 +749,7 @@ END
end
def resolve_newlines
return unless @newlines > 0
@precompiled << "\n" * @newlines
@newlines = 0
end

View file

@ -35,7 +35,8 @@ END
# Regression tests
"- raise 'foo'\n\n\n\nbar" => ["foo", 1],
"= 'foo'\n-raise 'foo'" => ["foo", 2]
"= 'foo'\n-raise 'foo'" => ["foo", 2],
"\n\n\n- raise 'foo'" => ["foo", 4],
}
User = Struct.new('User', :id)