diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-06-03 21:47:07 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-06-03 21:47:07 +0200 |
commit | cfc38883b4b0247f21cb3403845d2fe3df06df0c (patch) | |
tree | 43e426589f3066f3452e308c32f589605f56a5bb /askama_shared/src/parser.rs | |
parent | d7d18d3ec671872e5063117709339056982d9da3 (diff) | |
download | askama-cfc38883b4b0247f21cb3403845d2fe3df06df0c.tar.gz askama-cfc38883b4b0247f21cb3403845d2fe3df06df0c.tar.bz2 askama-cfc38883b4b0247f21cb3403845d2fe3df06df0c.zip |
Revert whitespace matching to old macro behavior
Diffstat (limited to '')
-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)) } } |