mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 03:10:39 -07:00
add global_filter
add a global filter using a proc only add one proc and not an array add tests to make sure the global_filter is applied after native filters
This commit is contained in:
+7
-12
@@ -179,20 +179,15 @@ module Liquid
|
||||
when Hash
|
||||
options = args.pop
|
||||
|
||||
if options[:registers].is_a?(Hash)
|
||||
registers.merge!(options[:registers])
|
||||
end
|
||||
registers.merge!(options[:registers]) if options[:registers].is_a?(Hash)
|
||||
|
||||
if options[:filters]
|
||||
context.add_filters(options[:filters])
|
||||
end
|
||||
context.add_filters(options[:filters]) if options[:filters]
|
||||
|
||||
if options[:exception_handler]
|
||||
context.exception_handler = options[:exception_handler]
|
||||
end
|
||||
when Module
|
||||
context.add_filters(args.pop)
|
||||
when Array
|
||||
context.global_filter = options[:global_filter] if options[:global_filter]
|
||||
|
||||
context.exception_handler = options[:exception_handler] if options[:exception_handler]
|
||||
|
||||
when Module, Array
|
||||
context.add_filters(args.pop)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user