parent
2b659be947
commit
684a1c0fba
|
@ -87,7 +87,7 @@ module Sinatra
|
|||
def capture(*args, &block)
|
||||
return block[*args] if ruby?
|
||||
|
||||
if haml? && Tilt[:haml] == Tilt::HamlTemplate
|
||||
if haml? && Tilt[:haml] == Tilt::HamlTemplate && defined?(Haml::Buffer)
|
||||
buffer = Haml::Buffer.new(nil, Haml::Options.new.for_buffer)
|
||||
with_haml_buffer(buffer) { capture_haml(*args, &block) }
|
||||
else
|
||||
|
|
|
@ -175,7 +175,7 @@ module Sinatra
|
|||
# for <tt>:head</tt>.
|
||||
def yield_content(key, *args, &block)
|
||||
if block_given? && !content_for?(key)
|
||||
haml? && Tilt[:haml] == Tilt::HamlTemplate ? capture_haml(*args, &block) : yield(*args)
|
||||
haml? && Tilt[:haml] == Tilt::HamlTemplate && respond_to?(:capture_haml) ? capture_haml(*args, &block) : yield(*args)
|
||||
else
|
||||
content = content_blocks[key.to_sym].map { |b| capture(*args, &b) }
|
||||
content.join.tap do |c|
|
||||
|
|
|
@ -46,7 +46,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can
|
|||
s.add_development_dependency 'asciidoctor'
|
||||
s.add_development_dependency 'builder'
|
||||
s.add_development_dependency 'erubi'
|
||||
s.add_development_dependency 'haml', '~> 5'
|
||||
s.add_development_dependency 'haml'
|
||||
s.add_development_dependency 'liquid'
|
||||
s.add_development_dependency 'markaby'
|
||||
s.add_development_dependency 'nokogiri'
|
||||
|
|
|
@ -1 +1 @@
|
|||
= yield_content :foo, 1, 2
|
||||
!= yield_content :foo, 1, 2
|
||||
|
|
Loading…
Reference in New Issue