From 4ea4350775918cc9ec4d75e891f6f81deddd89c7 Mon Sep 17 00:00:00 2001 From: Tobi Lutke Date: Wed, 11 Mar 2026 08:31:30 -0400 Subject: [PATCH] clean up filter parsing: Lexer fallback for args, no-arg fast scan stays --- lib/liquid/variable.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/liquid/variable.rb b/lib/liquid/variable.rb index 62a8e611..41f00e7b 100644 --- a/lib/liquid/variable.rb +++ b/lib/liquid/variable.rb @@ -202,12 +202,10 @@ module Liquid # Skip whitespace filter_pos += 1 while filter_pos < len && markup.getbyte(filter_pos) == 32 - # Check for colon (has arguments) — use Lexer for the remaining filter chain + # Has arguments — use Lexer-based parser for this and remaining filters if filter_pos < len && markup.getbyte(filter_pos) == 58 # ':' - # Rewind to the '|' before this filter and use Lexer for the rest - # We already have filters parsed so far as no-arg filters + # Rewind to the '|' before this filter for the Lexer rest_start = fname_start - # Go back to find the '|' before this filter name rest_start -= 1 while rest_start > pos && markup.getbyte(rest_start) != 124 rest_markup = markup.byteslice(rest_start, len - rest_start) p = parse_context.new_parser(rest_markup)