Skip to main content

strip_code_spans

Function strip_code_spans 

Source
pub fn strip_code_spans(line: &str) -> String
Expand description

Return line with inline code spans removed, so tokens documented as examples (e.g. `[[path#Symbol]]` or ``@rto:0001``) are not scanned as real links or annotations.

Follows the CommonMark rule for code spans: a span opens with a run of n backticks and closes with the next run of exactly n backticks. An opening run with no matching close is literal text and is kept. Non-backtick text is preserved verbatim (backticks are ASCII, so all slice boundaries are valid).