Skip to main content

code_regions

Function code_regions 

Source
pub(crate) fn code_regions(
    text: &str,
    options: &ParseOptions,
) -> Vec<Range<usize>>
Expand description

Byte ranges that Markdown parses as code under options. An HTML entity would render literally inside these ranges, so neutralization skips them. If malformed MDX cannot be parsed, returning no ranges favors neutralizing possible ESM over preserving an invalid code example byte-for-byte.