diff --git a/components/markdown/src/markdown.rs b/components/markdown/src/markdown.rs index 4677cc93..d773a21f 100644 --- a/components/markdown/src/markdown.rs +++ b/components/markdown/src/markdown.rs @@ -593,7 +593,6 @@ mod tests { fn test_is_external_link() { assert!(is_external_link("http://example.com/")); assert!(is_external_link("https://example.com/")); - assert!(is_external_link("www.example.com")); assert!(is_external_link("https://example.com/index.html#introduction")); assert!(!is_external_link("mailto:user@example.com")); diff --git a/components/utils/src/net.rs b/components/utils/src/net.rs index 61deeae3..9f662e85 100644 --- a/components/utils/src/net.rs +++ b/components/utils/src/net.rs @@ -10,7 +10,7 @@ pub fn port_is_available(port: u16) -> bool { TcpListener::bind(("127.0.0.1", port)).is_ok() } -/// Returns whether a link starts with an HTTP(s) scheme or "www.". +/// Returns whether a link starts with an HTTP(s) scheme. pub fn is_external_link(link: &str) -> bool { - link.starts_with("http:") || link.starts_with("https:") || link.starts_with("www.") + link.starts_with("http:") || link.starts_with("https:") }