lib/haml/helpers/action_view_mods.rb in haml-4.1.0.alpha.2 vs lib/haml/helpers/action_view_mods.rb in haml-4.1.0.beta.1

- old
+ new

@@ -39,24 +39,12 @@ module CaptureHelper def capture_with_haml(*args, &block) if Haml::Helpers.block_is_haml?(block) #double assignment is to avoid warnings _hamlout = _hamlout = eval('_hamlout', block.binding) # Necessary since capture_haml checks _hamlout - value = nil - buffer = capture_haml(*args) { value = yield(*args) } - str = - if !buffer.empty? - buffer - elsif value.is_a?(String) - value - else - nil - end - # NonCattingString is present in Rails less than 3.1.0. When support - # for 3.0 is dropped, this can be removed. - return ActionView::NonConcattingString.new(str) if str && defined?(ActionView::NonConcattingString) - return str + + capture_haml(*args, &block) else capture_without_haml(*args, &block) end end alias_method :capture_without_haml, :capture @@ -149,6 +137,6 @@ end alias_method :form_for_without_haml, :form_for alias_method :form_for, :form_for_with_haml end end -end \ No newline at end of file +end