lib/sinatra/content_for.rb in sinatra-contrib-2.0.7 vs lib/sinatra/content_for.rb in sinatra-contrib-2.0.8
- old
+ new
@@ -172,10 +172,10 @@
#
# Would pass <tt>1</tt> and <tt>2</tt> to all the blocks registered
# for <tt>:head</tt>.
def yield_content(key, *args, &block)
if block_given? && !content_for?(key)
- haml? ? capture_haml(*args, &block) : yield(*args)
+ (haml? && Tilt[:haml] == Tilt::HamlTemplate) ? capture_haml(*args, &block) : yield(*args)
else
content = content_blocks[key.to_sym].map { |b| capture(*args, &b) }
content.join.tap do |c|
if block_given? && (erb? || erubi? || erubis?)
@_out_buf << c