Files
liquid/lib/liquid
Chris Pak d9c42fd2eb Fixes infinite loop in tokenizer on trailing stray '{'
The stray-{ else branch in tokenize_fast had a nested while loop that could
exit via its condition (when next_open >= len) without advancing pos.
The outer while pos < len loop would then find the same { again forever.

Reproduced by: Liquid::Template.parse('a{') -- hangs indefinitely.

Replaces the nested scan loop with two String#byteindex calls to find the
next '{%' and '{{' directly, then takes the minimum. Always O(n), eliminates
the nested loop entirely, and impossible to leave pos stranded.

Adds regression tests covering the three inputs that previously hung
plus adjacent stray-brace cases.
2026-04-04 21:25:59 -07:00
..
2025-11-19 18:03:23 +01:00
2025-11-19 18:03:23 +01:00
2024-01-12 12:17:20 -04:00
2026-01-01 20:20:50 -05:00
2025-11-19 18:03:23 +01:00
2019-12-17 21:45:08 -05:00
2025-11-19 18:03:23 +01:00