Fix invalid indices when content is not long enough

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-09 15:20:07 +01:00
parent fa1582f3ad
commit 462355b6f2
4 changed files with 25 additions and 7 deletions

View file

@ -383,10 +383,10 @@ fn parse_block_token<'input>(input: &mut Input<'input>) -> PResult<'input, Templ
"parse_block_token",
alt((
parse_ident,
parse_literal,
parse_condition_if,
parse_condition_else,
parse_end,
terminated(parse_literal, ident_terminator_check),
terminated(parse_condition_if, ident_terminator_check),
terminated(parse_condition_else, ident_terminator_check),
terminated(parse_end, ident_terminator_check),
parse_whitespace,
)),
)