Skip to main content

parse_help_links

Function parse_help_links 

Source
pub fn parse_help_links(text: &str) -> Vec<HelpLink>
Expand description

Walk text, locating every [label](url) markdown link and resolving the URL’s scheme into a typed HelpLinkTarget. Each returned HelpLink’s range covers the LABEL bytes (what the user sees as a clickable token) – the surrounding [, ], (, ), and URL bytes aren’t part of the highlighted range.

Unlike extract_links_and_clean this preserves the input text verbatim and returns ranges in the ORIGINAL text. Useful when the caller wants to keep the markdown source visible (markdown editor mode); the help-buffer constructor uses extract_links_and_clean to render labels-only.

Forms recognized:

No nested brackets; \\ escapes the link punctuation, which the *_link helpers apply for you (see escape_link_text).