From 7334073be272c6560baf89475ecbdece84ad8bfb Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Fri, 10 Feb 2017 13:49:26 -0500 Subject: [PATCH] Avoid duck typing to detect whether to call render on a node. --- lib/liquid/block_body.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/liquid/block_body.rb b/lib/liquid/block_body.rb index d69af1a..6c9b680 100644 --- a/lib/liquid/block_body.rb +++ b/lib/liquid/block_body.rb @@ -107,7 +107,7 @@ module Liquid private def render_node(node, context) - node_output = (node.respond_to?(:render) ? node.render(context) : node) + node_output = node.is_a?(String) ? node : node.render(context) node_output = node_output.is_a?(Array) ? node_output.join : node_output.to_s context.resource_limits.render_length += node_output.length