Skip to main content

normalize_url

Function normalize_url 

Source
pub fn normalize_url(url_str: &str) -> Option<String>
Expand description

Normalize URL (remove fragments, trailing slashes).

ยงExample

use html_cleaning::links;

assert_eq!(
    links::normalize_url("https://example.com/page#section"),
    Some("https://example.com/page".to_string())
);