Simplify secondary filter regex

This commit is contained in:
Tristan Hume
2014-08-13 09:36:02 -04:00
parent 292161865d
commit ffd4f9d959
+2 -2
View File
@@ -41,8 +41,8 @@ module Liquid
if Regexp.last_match(2) =~ /#{FilterSeparator}\s*(.*)/om if Regexp.last_match(2) =~ /#{FilterSeparator}\s*(.*)/om
filters = Regexp.last_match(1).scan(FilterParser) filters = Regexp.last_match(1).scan(FilterParser)
filters.each do |f| filters.each do |f|
if f =~ /\s*(\w+)/ if f =~ /\w+/
filtername = Regexp.last_match(1) filtername = Regexp.last_match(0)
filterargs = f.scan(/(?:#{FilterArgumentSeparator}|#{ArgumentSeparator})\s*((?:\w+\s*\:\s*)?#{QuotedFragment})/o).flatten filterargs = f.scan(/(?:#{FilterArgumentSeparator}|#{ArgumentSeparator})\s*((?:\w+\s*\:\s*)?#{QuotedFragment})/o).flatten
@filters << [filtername, filterargs] @filters << [filtername, filterargs]
end end