Reuse filters array during variable parsing

This commit is contained in:
Lourens Naudé
2015-05-05 23:30:05 -04:00
parent 01a86728f2
commit 174839fbef
+4 -2
View File
@@ -33,7 +33,8 @@ module Liquid
end end
def lax_parse(markup) def lax_parse(markup)
@filters = [] @filters ||= []
@filters.clear
if markup =~ /(#{QuotedFragment})(.*)/om if markup =~ /(#{QuotedFragment})(.*)/om
name_markup = $1 name_markup = $1
filter_markup = $2 filter_markup = $2
@@ -52,7 +53,8 @@ module Liquid
end end
def strict_parse(markup) def strict_parse(markup)
@filters = [] @filters ||= []
@filters.clear
p = Parser.new(markup) p = Parser.new(markup)
@name = Expression.parse(p.expression) @name = Expression.parse(p.expression)