From 9eeea250cd6cf1e3e28f6a2b4c6f568c346f97ce Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 29 Nov 2022 00:38:43 +0100 Subject: [PATCH] Exclude + i'm fine + "#; + let expected = vec![RawUri { + text: "https://example.org".to_string(), + element: Some("a".to_string()), + attribute: Some("href".to_string()), + }]; + let uris = extract_html(input, false); + assert_eq!(uris, expected); + } } diff --git a/lychee-lib/src/extract/html5gum.rs b/lychee-lib/src/extract/html5gum.rs index e641375..624f289 100644 --- a/lychee-lib/src/extract/html5gum.rs +++ b/lychee-lib/src/extract/html5gum.rs @@ -316,4 +316,21 @@ mod tests { let uris = extract_html(input, false); assert_eq!(uris, expected); } + + #[test] + fn test_exclude_script_tags() { + let input = r#" + + i'm fine + "#; + let expected = vec![RawUri { + text: "https://example.org".to_string(), + element: Some("a".to_string()), + attribute: Some("href".to_string()), + }]; + let uris = extract_html(input, false); + assert_eq!(uris, expected); + } } diff --git a/lychee-lib/src/extract/mod.rs b/lychee-lib/src/extract/mod.rs index 1c41666..20f9fe6 100644 --- a/lychee-lib/src/extract/mod.rs +++ b/lychee-lib/src/extract/mod.rs @@ -11,10 +11,13 @@ use plaintext::extract_plaintext; /// Check if the given element is in the list of preformatted ("verbatim") tags. /// /// These will be excluded from link checking by default. +// Including the