Skip to main content

code_span_labels

Function code_span_labels 

fn code_span_labels(doc: &str) -> String
Expand description

Puts the label of [label](rust::path) into a code span.

markdown::strip_intra_doc_links understands rustdoc’s [`Item`](path) spelling and fails closed on any other label, which is right for the three Markdown generators: their prose is a handful of maintainer-written comments, and stopping the run is how a bad link gets fixed. pystub is different in kind — its input is every doc comment in crates/atune_py/src verbatim, and crates/atune_py/src/study.rs uses the plain-label spelling ([pruned](atune_facade::trial::TrialState::Pruned)), a file M7.D3 does not own (§14: those doc comments are M7.D7’s). Refusing to translate a legal rustdoc link would not be fail-closed, it would be stuck.

So this normalises the label into a code span and hands the result to the shared rewrite, which then applies its own rules unchanged — including its refusal of anything it still cannot classify. Only a target carrying :: is touched, so an ordinary relative link is never disturbed.