Module: ActionView::Helpers::TagHelper

Defined in:
lib/haml/helpers/action_view_mods.rb

Instance Method Summary collapse

Instance Method Details

#content_tag_with_haml(name, *args, &block) ⇒ Object Also known as: content_tag



101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/haml/helpers/action_view_mods.rb', line 101

def (name, *args, &block)
  return (name, *args, &block) unless is_haml?

  preserve = haml_buffer.options[:preserve].include?(name.to_s)

  if block_given? && block_is_haml?(block) && preserve
    return (name, *args) {preserve(&block)}
  end

  returning (name, *args, &block) do |content|
    return Haml::Helpers.preserve(content) if preserve && content
  end
end