normalize_reference

Function normalize_reference 

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

Unicode case folding + space normalization, used for for reference labels.

So that strings equal according to commonmark standard are converted to the same string (lowercase/uppercase differences and spacing go away).

assert_eq!(normalize_reference("hello"), normalize_reference("HELLO"));
assert_eq!(normalize_reference("a   b"), normalize_reference("a b"));