File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed
sinatra-contrib/lib/sinatra Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ module Capture
8686
8787 def capture ( *args , &block )
8888 return block [ *args ] if ruby?
89- if haml?
89+ if haml? && Tilt [ :haml ] == Tilt :: HamlTemplate
9090 buffer = Haml ::Buffer . new ( nil , Haml ::Options . new . for_buffer )
9191 with_haml_buffer ( buffer ) { capture_haml ( *args , &block ) }
9292 else
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def clear_content_for(key)
174174 # for <tt>:head</tt>.
175175 def yield_content ( key , *args , &block )
176176 if block_given? && !content_for? ( key )
177- haml? ? capture_haml ( *args , &block ) : yield ( *args )
177+ ( haml? && Tilt [ :haml ] == Tilt :: HamlTemplate ) ? capture_haml ( *args , &block ) : yield ( *args )
178178 else
179179 content = content_blocks [ key . to_sym ] . map { |b | capture ( *args , &b ) }
180180 content . join . tap do |c |
Original file line number Diff line number Diff line change @@ -29,10 +29,9 @@ def erubis?
2929 erb? && Tilt [ :erb ] == Tilt ::ErubisTemplate
3030 end
3131
32- # @return [Boolean] Returns true if current engine is `:haml` and
33- # `Tilt[:haml]` is set to `Tilt::HamlTemplate`.
32+ # @return [Boolean] Returns true if current engine is `:haml`.
3433 def haml?
35- @current_engine == :haml && Tilt [ :haml ] == Tilt :: HamlTemplate
34+ @current_engine == :haml
3635 end
3736
3837 # @return [Boolean] Returns true if current engine is `:sass`.
You can’t perform that action at this time.
0 commit comments