Fixing an output-indentation bug with self-closed tags. Thanks to Nicolas Sanguinetti for pointing this out.

git-svn-id: svn://hamptoncatlin.com/haml/trunk@729 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
nex3 2008-01-17 18:41:27 +00:00
parent 502c96fc8b
commit 54f47300fc
2 changed files with 5 additions and 1 deletions

View File

@ -115,7 +115,7 @@ module Haml
else
@buffer << "\n#{tabs(@real_tabs+1)}#{content}\n#{tabs(@real_tabs)}</#{name}>\n"
end
else
elsif !atomic
@real_tabs += 1
end
end

View File

@ -173,6 +173,10 @@ class EngineTest < Test::Unit::TestCase
assert_equal("<p a='b2c'>\n</p>\n", render("%p{:a => 'b' + (1 + 1).to_s + 'c'}"))
end
def test_dynamic_attrs_with_self_closed_tag
assert_equal("<a b='2' />\nc\n", render("%a{'b' => 1 + 1}/\n= 'c'\n"))
end
def test_rec_merge
hash1 = {1=>2, 3=>{5=>7, 8=>9}}
hash2 = {4=>5, 3=>{5=>2, 16=>12}}