fix partials used with blocks
This commit is contained in:
parent
a2181a2fd9
commit
b1778a92cd
|
@ -50,3 +50,10 @@ Feature: Provide Sane Defaults for Partial Behavior
|
|||
Then I should see "File Not Found"
|
||||
When I go to "/_code_snippet.html"
|
||||
Then I should see "File Not Found"
|
||||
|
||||
Scenario: Works with blocks
|
||||
Given the Server is running at "partials-app"
|
||||
When I go to "/block.html"
|
||||
Then I should see "Start"
|
||||
And I should see "Contents"
|
||||
And I should see "End"
|
||||
|
|
3
middleman-core/fixtures/partials-app/source/_block.erb
Normal file
3
middleman-core/fixtures/partials-app/source/_block.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
Start
|
||||
<%= yield %>
|
||||
End
|
|
@ -0,0 +1,3 @@
|
|||
<% partial "block" do %>
|
||||
Contents
|
||||
<% end %>
|
|
@ -96,8 +96,9 @@ module Middleman
|
|||
#
|
||||
# @param [String, Symbol] name The partial to render.
|
||||
# @param [Hash] options
|
||||
# @param [Proc] block A block will be evaluated to return internal contents.
|
||||
# @return [String]
|
||||
Contract Any, Or[Symbol, String], Hash => String
|
||||
Contract Any, Or[Symbol, String], Hash => String, Maybe[Proc] => String
|
||||
def render(_, name, options={}, &block)
|
||||
name = name.to_s
|
||||
|
||||
|
|
Loading…
Reference in a new issue