diff options
Diffstat (limited to 'askama_shared/src/parser.rs')
-rw-r--r-- | askama_shared/src/parser.rs | 14 |
1 files changed, 8 insertions, 6 deletions
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<I>, { 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)) } } |