Skip to content

Commit

Permalink
Handle HTML comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shff committed Dec 28, 2022
1 parent 9b7a934 commit 3c954f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("<!--"), tag("-->")));
capture(trio(comments, take_until("\n"), tag("\n")))(i)
}

fn multi_comment<'a>(i: &'a str) -> ParseResult<&'a str> {
Expand Down

0 comments on commit 3c954f2

Please sign in to comment.