From cfc38883b4b0247f21cb3403845d2fe3df06df0c Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 3 Jun 2020 21:47:07 +0200 Subject: Revert whitespace matching to old macro behavior --- askama_shared/src/parser.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'askama_shared/src/parser.rs') diff --git a/askama_shared/src/parser.rs b/askama_shared/src/parser.rs index ec4db11..67d28b4 100644 --- a/askama_shared/src/parser.rs +++ b/askama_shared/src/parser.rs @@ -113,13 +113,15 @@ where E: ParseError, { move |i: I| { - let i = many0(alt::<_, _, (), _>((tag(b" "), tag(b"\t"))))(i.clone()) - .map(|(i, _)| i) - .unwrap_or(i); + let ws = many0(alt::<_, _, (), _>(( + tag(b" "), + tag(b"\t"), + tag(b"\r"), + tag(b"\n"), + ))); + let i = ws(i.clone()).map(|(i, _)| i).unwrap_or(i); let (i, res) = inner(i)?; - let i = many0(alt::<_, _, (), _>((tag(b" "), tag(b"\t"))))(i.clone()) - .map(|(i, _)| i) - .unwrap_or(i); + let i = ws(i.clone()).map(|(i, _)| i).unwrap_or(i); Ok((i, res)) } } -- cgit