skip filter arg splat for no-arg filters, trim render loop comments

This commit is contained in:
Tobi Lutke
2026-04-04 17:42:32 -07:00
committed by Chris Pak
parent 48a2fae5f6
commit 62877e666c
2 changed files with 7 additions and 6 deletions
+1 -4
View File
@@ -309,10 +309,7 @@ module Liquid
output << node
else
render_node(context, output, node)
# If we get an Interrupt that means the block must stop processing. An
# 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
break if context.interrupt?
end
idx += 1
+6 -2
View File
@@ -254,8 +254,12 @@ module Liquid
obj = context.evaluate(@name)
@filters.each do |filter_name, filter_args, filter_kwargs|
filter_args = evaluate_filter_expressions(context, filter_args, filter_kwargs)
obj = context.invoke(filter_name, obj, *filter_args)
if filter_args.empty? && !filter_kwargs
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
context.apply_global_filter(obj)