From f709bf7ffb24847d70a9f7ec1349888a17c98146 Mon Sep 17 00:00:00 2001 From: vallentin Date: Wed, 6 Jan 2021 22:24:21 +0100 Subject: Fixed comment parsing --- askama_shared/src/parser.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/askama_shared/src/parser.rs b/askama_shared/src/parser.rs index 3b3d4f4..0b42b13 100644 --- a/askama_shared/src/parser.rs +++ b/askama_shared/src/parser.rs @@ -1074,13 +1074,7 @@ fn block_comment<'a>(i: &'a [u8], s: &'a Syntax<'a>) -> IResult<&'a [u8], Node<' |i| tag_comment_end(i, s), )); let (i, (_, pws, tail, _)) = p(i)?; - Ok(( - i, - Node::Comment(WS( - pws.is_some(), - tail.len() > 1 && tail[tail.len() - 1] == b'-', - )), - )) + Ok((i, Node::Comment(WS(pws.is_some(), tail.ends_with(b"-"))))) } fn parse_template<'a>(i: &'a [u8], s: &'a Syntax<'a>) -> IResult<&'a [u8], Vec>> { -- cgit