Skip to main content

resolve_reference_links

Function resolve_reference_links 

pub fn resolve_reference_links(text: &str) -> String
Expand description

Resolves rustdoc’s reference-style link definitions, then removes them.

A doc comment often writes [Space] in the prose and puts [Space]: https://docs.rs/atune on a line of its own at the bottom. Left alone, the definition line would be published as a stray paragraph and the shortcut would lose its URL. Each definition whose target is a real URL is inlined into every use of its label; a definition whose target is a Rust item path is dropped, leaving the shortcut for strip_intra_doc_links to turn into a code span.

Lines inside a fenced code block are left alone: a fence can legitimately contain something shaped like a definition.