Function normalize_reference

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

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

So that strings equal, according to the 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"));