From 3c954f23d5e58d9fbbd3d4dea58574bdb4b3ca16 Mon Sep 17 00:00:00 2001 From: Silvio Henrique Ferreira Date: Thu, 29 Dec 2022 00:11:58 +0100 Subject: [PATCH] Handle HTML comments --- src/parser.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index 20fda4f1..eaf75049 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -504,7 +504,8 @@ fn comments<'a>(i: &'a str) -> ParseResult<&'a str> { } fn single_comment<'a>(i: &'a str) -> ParseResult<&'a str> { - capture(trio(tag("//"), take_until("\n"), tag("\n")))(i) + let comments = choice((tag("//"), tag(""))); + capture(trio(comments, take_until("\n"), tag("\n")))(i) } fn multi_comment<'a>(i: &'a str) -> ParseResult<&'a str> {