mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
apply "o" option to regexps to improve process time
This commit is contained in:
@@ -18,14 +18,14 @@ module Liquid
|
||||
@markup = markup
|
||||
@name = nil
|
||||
@filters = []
|
||||
if match = markup.match(/\s*(#{QuotedFragment})(.*)/)
|
||||
if match = markup.match(/\s*(#{QuotedFragment})(.*)/o)
|
||||
@name = match[1]
|
||||
if match[2].match(/#{FilterSeparator}\s*(.*)/)
|
||||
if match[2].match(/#{FilterSeparator}\s*(.*)/o)
|
||||
filters = Regexp.last_match(1).scan(FilterParser)
|
||||
filters.each do |f|
|
||||
if matches = f.match(/\s*(\w+)/)
|
||||
filtername = matches[1]
|
||||
filterargs = f.scan(/(?:#{FilterArgumentSeparator}|#{ArgumentSeparator})\s*(#{QuotedFragment})/).flatten
|
||||
filterargs = f.scan(/(?:#{FilterArgumentSeparator}|#{ArgumentSeparator})\s*(#{QuotedFragment})/o).flatten
|
||||
@filters << [filtername.to_sym, filterargs]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user