Skip to content

Commit

Permalink
Skip over some known divergence between implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Jan 21, 2024
1 parent 0e406a1 commit 9b5cd31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 0 additions & 5 deletions fuzz/fuzz_targets/commonmark_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ fuzz_target!(|text: String| {
return;
}

// https://github.com/raphlinus/pulldown-cmark/issues/659
if text.contains("<") {
return;
}

// There are some trivial differences due to trailing whitespace.
let text = text
.lines()
Expand Down
3 changes: 3 additions & 0 deletions fuzz/fuzz_targets/pandoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ fuzz_target!(|text: String| {
if text.contains("[\r") {
return;
}
if text.contains("`") {
return;
}

if text.bytes().any(|b| b > 127) {
return;
Expand Down
5 changes: 4 additions & 1 deletion fuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,13 @@ pub fn normalize(events: Vec<Event<'_>>) -> Vec<Event<'_>> {
dest_url,
title,
id: _,
link_type,
..
}) => vec![Event::Start(Tag::Link {
link_type: LinkType::Inline,
dest_url: dest_url.clone(),
// pandoc and commonmark.js both turn <i@e> into <mailto:i@e> and don't
// distinguish between them
dest_url: format!("{e}{dest_url}", e = if link_type == LinkType::Email { "mailto:" } else { "" }).into(),
title: title.clone(),
// commonmark.js does not record the id, either
id: "".into(),
Expand Down

0 comments on commit 9b5cd31

Please sign in to comment.