Skip to main content

normalize_reference_label

Function normalize_reference_label 

Source
pub fn normalize_reference_label(label: &str) -> String
Expand description

Normalize a reference label for definition matching: collapse internal whitespace runs to a single space, trim, and lowercase (CommonMark-style label matching). Both the defined labels and the shortcut references checked against them are run through this function, so matching is case- and whitespace-insensitive. Biasing toward matching keeps a real shortcut link atomic even when its use and definition differ only in case or whitespace.