Skip to main content

code_regions

Function code_regions 

Source
fn code_regions(text: &str) -> Vec<Range<usize>>
Expand description

Byte ranges that MDX parses as code. 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.