Convert render output to strings in BlockBody

This commit is contained in:
Justin Li
2014-12-05 15:17:09 -05:00
parent 742b3c69bb
commit 9f7e601110
4 changed files with 9 additions and 21 deletions
+4 -2
View File
@@ -104,11 +104,13 @@ module Liquid
def render_token(token, context)
token_output = (token.respond_to?(:render) ? token.render(context) : token)
context.resource_limits.increment_render_length(token_output)
token_str = token_output.is_a?(Array) ? token_output.join : token_output.to_s
context.resource_limits.render_length += token_str.length
if context.resource_limits.reached?
raise MemoryError.new("Memory limits exceeded".freeze)
end
token_output
token_str
end
def create_variable(token, options)