Skip to main content

generate_heading_anchors

Function generate_heading_anchors 

Source
pub fn generate_heading_anchors(lines: &[String]) -> Vec<HelpAnchor>
Expand description

Walk lines for ATX-style markdown headings (#, ##, …) and emit a HelpAnchor per heading whose name is the GitHub-style slug. Used by the help-topic loader so authors can write [label](#slug) in markdown bodies and have the link route in- editor without manually-managed anchor lists.

Skips heading-shaped lines inside fenced code blocks (``` / ~~~) so a # foo line in a Rust example doesn’t register as an anchor.