From 3f0373adf268298c99a64a7f5f614705c3d0d92f Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Sun, 11 May 2014 13:44:58 -0400 Subject: [PATCH] Fix after_render Example usage from config.rb: after_render do |content, path, locs, template_class| # restore character entities such as ` content ||= '' content.gsub! '&', '&' content end --- .../lib/middleman-core/core_extensions/rendering.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/middleman-core/lib/middleman-core/core_extensions/rendering.rb b/middleman-core/lib/middleman-core/core_extensions/rendering.rb index f6737724..98c0b600 100644 --- a/middleman-core/lib/middleman-core/core_extensions/rendering.rb +++ b/middleman-core/lib/middleman-core/core_extensions/rendering.rb @@ -265,7 +265,12 @@ module Middleman # Allow hooks to manipulate the result after render self.class.callbacks_for_hook(:after_render).each do |callback| - content = callback.call(content, path, locs, template_class) + # Uber::Options::Value doesn't respond to call + if callback.respond_to?(:call) + content = callback.call(content, path, locs, template_class) + elsif callback.respond_to?(:evaluate) + content = callback.evaluate(self, content, path, locs, template_class) + end end output = ::ActiveSupport::SafeBuffer.new ''