pub fn unicode_length(text: &str) -> usize
Expand description
Count the length of a string in Unicode scalars
This is useful for generating heading IDs and other cases where we need to know the true length of a string.
§Arguments
text
- The text to measure
§Example
let len = pulldown_html_ext::utils::unicode_length("Hello 👋");
assert_eq!(len, 7); // 6 ASCII chars + 1 emoji