mirror of
https://github.com/kemko/liquid.git
synced 2026-01-05 09:45:40 +03:00
Avoid duck typing to detect whether to call render on a node.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user