aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared
diff options
context:
space:
mode:
authorLibravatar vallentin <mail@vallentin.dev>2021-01-06 22:24:21 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2021-01-06 23:03:49 +0100
commitf709bf7ffb24847d70a9f7ec1349888a17c98146 (patch)
tree353e2e25f84ccff5bf70e98dc54d628b12a180d3 /askama_shared
parentf9db4446d5325b1cd6fa6154a7630e5138b61975 (diff)
downloadaskama-f709bf7ffb24847d70a9f7ec1349888a17c98146.tar.gz
askama-f709bf7ffb24847d70a9f7ec1349888a17c98146.tar.bz2
askama-f709bf7ffb24847d70a9f7ec1349888a17c98146.zip
Fixed comment parsing
Diffstat (limited to 'askama_shared')
-rw-r--r--askama_shared/src/parser.rs8
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>>> {