lib/arbre/element/builder_methods.rb in arbre-1.1.1 vs lib/arbre/element/builder_methods.rb in arbre-1.2.0.rc1

- old
+ new

@@ -63,20 +63,19 @@ end # Returns true if the object should be converted into a text node # and appended into the DOM. def appendable_tag?(tag) - is_appendable = !tag.is_a?(Arbre::Element) && tag.respond_to?(:to_s) - - # In ruby 1.9, Arraay.new.to_s prints out an empty array ("[]"). In + # Array.new.to_s prints out an empty array ("[]"). In # Arbre, we append the return value of blocks to the output, which # can cause empty arrays to show up within the output. To get # around this, we check if the object responds to #empty? if tag.respond_to?(:empty?) && tag.empty? - is_appendable = false + false + else + !tag.is_a?(Arbre::Element) && tag.respond_to?(:to_s) end - is_appendable end end end end