mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 18:30:40 -07:00
skip filter arg splat for no-arg filters, trim render loop comments
This commit is contained in:
@@ -309,10 +309,7 @@ module Liquid
|
|||||||
output << node
|
output << node
|
||||||
else
|
else
|
||||||
render_node(context, output, node)
|
render_node(context, output, node)
|
||||||
# If we get an Interrupt that means the block must stop processing. An
|
break if context.interrupt?
|
||||||
# Interrupt is any command that stops block execution such as {% break %}
|
|
||||||
# or {% continue %}. These tags may also occur through Block or Include tags.
|
|
||||||
break if context.interrupt? # might have happened in a for-block
|
|
||||||
end
|
end
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
||||||
|
|||||||
@@ -254,8 +254,12 @@ module Liquid
|
|||||||
obj = context.evaluate(@name)
|
obj = context.evaluate(@name)
|
||||||
|
|
||||||
@filters.each do |filter_name, filter_args, filter_kwargs|
|
@filters.each do |filter_name, filter_args, filter_kwargs|
|
||||||
filter_args = evaluate_filter_expressions(context, filter_args, filter_kwargs)
|
if filter_args.empty? && !filter_kwargs
|
||||||
obj = context.invoke(filter_name, obj, *filter_args)
|
obj = context.invoke(filter_name, obj)
|
||||||
|
else
|
||||||
|
filter_args = evaluate_filter_expressions(context, filter_args, filter_kwargs)
|
||||||
|
obj = context.invoke(filter_name, obj, *filter_args)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context.apply_global_filter(obj)
|
context.apply_global_filter(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user