From d7d18d3ec671872e5063117709339056982d9da3 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 3 Jun 2020 21:39:08 +0200 Subject: Strip 0 or more instead of 1 whitespace character (fixes #337) --- askama_shared/src/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'askama_shared/src/parser.rs') diff --git a/askama_shared/src/parser.rs b/askama_shared/src/parser.rs index 10c4ce8..ec4db11 100644 --- a/askama_shared/src/parser.rs +++ b/askama_shared/src/parser.rs @@ -113,11 +113,11 @@ where E: ParseError, { move |i: I| { - let i = alt::<_, _, (), _>((tag(b" "), tag(b"\t")))(i.clone()) + let i = many0(alt::<_, _, (), _>((tag(b" "), tag(b"\t"))))(i.clone()) .map(|(i, _)| i) .unwrap_or(i); let (i, res) = inner(i)?; - let i = alt::<_, _, (), _>((tag(b" "), tag(b"\t")))(i.clone()) + let i = many0(alt::<_, _, (), _>((tag(b" "), tag(b"\t"))))(i.clone()) .map(|(i, _)| i) .unwrap_or(i); Ok((i, res)) -- cgit