Skip to content

Commit

Permalink
Merge pull request #855 from notriddle/notriddle/email-linktype-fuzz
Browse files Browse the repository at this point in the history
commonmark_js fuzzer: fix spurious email link fuzzer error
  • Loading branch information
Martin1887 committed Mar 2, 2024
2 parents 3525d2a + a3c6bc7 commit 86c5ff3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,17 @@ pub fn normalize(events: Vec<Event<'_>>) -> Vec<Event<'_>> {
.into_iter()
.filter_map(|event| match event {
// commonmark.js does not record the link type.
Event::Start(Tag::Link {
link_type: LinkType::Email,
dest_url,
title,
..
}) => Some(Event::Start(Tag::Link {
link_type: LinkType::Inline,
dest_url: format!("mailto:{dest_url}").into(),
title: title.clone(),
id: "".into(), // commonmark.js does not record this
})),
Event::Start(Tag::Link {
dest_url,
title,
Expand Down

0 comments on commit 86c5ff3

Please sign in to comment.