diff options
author | vallentin <mail@vallentin.dev> | 2021-01-06 22:24:21 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2021-01-06 23:03:49 +0100 |
commit | f709bf7ffb24847d70a9f7ec1349888a17c98146 (patch) | |
tree | 353e2e25f84ccff5bf70e98dc54d628b12a180d3 /askama_shared/src/parser.rs | |
parent | f9db4446d5325b1cd6fa6154a7630e5138b61975 (diff) | |
download | askama-f709bf7ffb24847d70a9f7ec1349888a17c98146.tar.gz askama-f709bf7ffb24847d70a9f7ec1349888a17c98146.tar.bz2 askama-f709bf7ffb24847d70a9f7ec1349888a17c98146.zip |
Fixed comment parsing
Diffstat (limited to '')
-rw-r--r-- | askama_shared/src/parser.rs | 8 |
1 files changed, 1 insertions, 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<Node<'a>>> { |