diff --git a/lib/haml/compiler.rb b/lib/haml/compiler.rb index 391e9c3b..c50c5c46 100644 --- a/lib/haml/compiler.rb +++ b/lib/haml/compiler.rb @@ -195,7 +195,7 @@ END elsif attributes_hashes.size == 1 attributes_hashes = ", #{attributes_hashes.first}" else - attributes_hashes = ", (#{attributes_hashes.join(").merge(")})" + attributes_hashes = ", #{attributes_hashes.join(", ")}" end push_merged_text "<#{t[:name]}", 0, !t[:nuke_outer_whitespace] diff --git a/test/engine_test.rb b/test/engine_test.rb index c7c40b15..5f0b46a7 100644 --- a/test/engine_test.rb +++ b/test/engine_test.rb @@ -214,6 +214,11 @@ HAML render(".no_attributes{:nil => nil}").chomp) end + def test_attribute_method_with_both_attrib_styles_and_non_static_hashes + assert_equal("
", + render("%div{{:foo => 'bar'}, :baz => 'qux'}(zig = val)", :locals => {:val => 'zag'}).chomp) + end + def test_strings_should_get_stripped_inside_tags assert_equal("
This should have no spaces in front of it
", render(".stripped This should have no spaces in front of it").chomp)