skip TagAttributes scan in for tag when no colon present

This commit is contained in:
Tobi Lutke
2026-04-04 17:33:53 -07:00
committed by Chris Pak
parent 01f33e96e8
commit 8f67d81023
+5 -2
View File
@@ -79,8 +79,11 @@ module Liquid
@reversed = !!Regexp.last_match(3)
@name = "#{@variable_name}-#{collection_name}"
@collection_name = parse_expression(collection_name)
markup.scan(TagAttributes) do |key, value|
set_attribute(key, value)
# Only scan for limit:/offset: attributes if markup contains ':'
if markup.include?(':')
markup.scan(TagAttributes) do |key, value|
set_attribute(key, value)
end
end
else
raise SyntaxError, options[:locale].t("errors.syntax.for")