Trait markdown_it::parser::linkfmt::LinkFormatter
source · pub trait LinkFormatter: Debug + Send + Sync {
// Required methods
fn validate_link(&self, url: &str) -> Option<()>;
fn normalize_link(&self, url: &str) -> String;
fn normalize_link_text(&self, url: &str) -> String;
}Required Methods§
sourcefn validate_link(&self, url: &str) -> Option<()>
fn validate_link(&self, url: &str) -> Option<()>
Validate link url, return Some(()) if it is allowed
and None if it is a security risk.
sourcefn normalize_link(&self, url: &str) -> String
fn normalize_link(&self, url: &str) -> String
Encode link url to a machine-readable format, which includes url-encoding, punycode, etc.
sourcefn normalize_link_text(&self, url: &str) -> String
fn normalize_link_text(&self, url: &str) -> String
Decode link url to a human-readable format.