Skip to main content

strip_trailing_label

Function strip_trailing_label 

Source
pub(crate) fn strip_trailing_label(
    src: &str,
    start: usize,
    end: usize,
) -> (usize, Option<ParsedLabel>)
Expand description

If the substring src[start..end] ends with <label> (after any trailing ASCII whitespace), return (text_end, Some(id)) where text_end is the offset of the first byte to exclude from the preceding text – trailing whitespace before the label is also trimmed. Otherwise return (end, None).