Merge pull request #1578 from ashfurrow/after_render-fix

Fixes problem with after_render hooks returning nil.
v3-stable
Thomas Reynolds 2015-09-17 09:35:37 -07:00
commit 2870647097
1 changed files with 2 additions and 2 deletions

View File

@ -316,9 +316,9 @@ module Middleman
self.class.callbacks_for_hook(:after_render).each do |callback|
# Uber::Options::Value doesn't respond to call
newcontent = if callback.respond_to?(:call)
content = callback.call(content, path, locs, template_class)
callback.call(content, path, locs, template_class)
elsif callback.respond_to?(:evaluate)
content = callback.evaluate(self, content, path, locs, template_class)
callback.evaluate(self, content, path, locs, template_class)
end
content = newcontent if newcontent # Allow the callback to return nil to skip it
end