mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Reuse filters array during variable parsing
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user