Skip to main content

code_spans

Function code_spans 

Source
pub fn code_spans(
    body: &str,
    format: ContentFormat,
) -> Result<Vec<Range<usize>>>
Expand description

The byte ranges in body that twig parses as code (inline code spans, fenced code blocks, raw inline/block escapes) — everything a link scan should treat as opaque; see crate::link::scan_wikilinks. Spans are returned sorted by start offset, and cover code inside a footnote definition as well as code in the document body (see spans_where).