Skip to main content

extract_references

Function extract_references 

Source
pub fn extract_references(text: &str) -> Vec<RefMention>
Expand description

Extract every GitHub-style issue/PR reference from text.

A #N immediately preceded (skipping whitespace/:) by a closing keyword is RefKind::Closes; every other #N is RefKind::Mentions. A # not immediately followed by at least one digit, or a digit run immediately followed by another alphanumeric character (e.g. #54abc, not a clean reference), is skipped. May return duplicate (number, kind) pairs for text with repeated references – callers that materialize one edge per referenced number should dedupe (see dedupe_prefer_closes).