Skip to main content

extract_markdown_fragments

Function extract_markdown_fragments 

Source
pub(crate) fn extract_markdown_fragments(input: &str) -> HashSet<String>
Expand description

Extract fragments/anchors from a Markdown string.

Fragments are generated from headings using the same unique kebab case method as GitHub. If a heading attribute is present, this will be added to the fragment set alongside the other generated fragment. It means a single heading such as ## Frag 1 {#frag-2} would generate two fragments.