From e475b015d3171fb4c4f140db304f7970c787d6e3 Mon Sep 17 00:00:00 2001 From: Matt Wildig Date: Thu, 21 Feb 2013 00:34:26 +0000 Subject: [PATCH] Fix for attribute methods See 0ea157839f7fbc98d058cf4af2dac0d007ea4416 The call to `merge` isn't necessary since the hashes are merged in the call to `Buffer#attributes` with `merge_attrs` This commit can result in different behaviour in certain case, since the hashes are being merged with `merge_attrs` which handles `class` and `id` attributes. Previously the value from the 'old style' would replace the value from the 'new style` e.g. %p.the_class{:class => old_attrs}(class = new_attrs) (where `old_attrs` and `new_attrs` are methods that return 'old' or 'new') Previously this would result in:

with this commit the result is:

--- lib/haml/compiler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/haml/compiler.rb b/lib/haml/compiler.rb index 3784bbc5..51001c11 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]