pub fn normalize_label(label: &str) -> StringExpand description
Normalise a refdef label per CommonMark §4.7.
- Strip leading and trailing whitespace.
- Collapse internal whitespace runs (any mixture of spaces, tabs, line endings) to a single space.
- Case-fold. CommonMark mandates Unicode case folding rather than
plain lowercasing; the two differ for characters whose folded
form is longer than the lowercased form, most notably the German
sharp S (
ẞlowercases toßbut folds toss). We approximate by lowercasing and then expanding any remainingßtoss— that matches the test renderer’snormalize_labeland is the only multi-character fold spec.txt exercises beyond ASCII (spec example #540).