diff --git a/lib/liquid/block.rb b/lib/liquid/block.rb index 4403a1b..327b642 100644 --- a/lib/liquid/block.rb +++ b/lib/liquid/block.rb @@ -14,9 +14,6 @@ module Liquid @nodelist ||= [] @nodelist.clear - # All child tags of the current block. - @children = [] - while token = tokens.shift case token when IsTag @@ -31,7 +28,6 @@ module Liquid new_tag = tag.new_with_options($1, $2, tokens, @options || {}) @blank &&= new_tag.blank? @nodelist << new_tag - @children << new_tag else # this tag is not registered with the system # pass it to the current block for special handling or error reporting @@ -43,7 +39,6 @@ module Liquid when IsVariable new_var = create_variable(token) @nodelist << new_var - @children << new_var @blank = false when '' # pass @@ -64,8 +59,8 @@ module Liquid all_warnings = [] all_warnings.concat(@warnings) if @warnings - (@children || []).each do |node| - all_warnings.concat(node.warnings || []) + (nodelist || []).each do |node| + all_warnings.concat(node.warnings || []) if node.respond_to?(:warnings) end all_warnings