Skip to main content

scan_math_regions

Function scan_math_regions 

Source
pub fn scan_math_regions(
    source: &str,
    exclusions: &[Range<usize>],
    transparent_runs: &[Range<usize>],
    cfg: MathConfig,
) -> (Vec<MathRegion>, Vec<MathError>)
Expand description

Scan source for math regions. Returns regions in source order (non-overlapping) and any unmatched openers / brace-imbalanced bodies as errors.

transparent_runs is a sorted, non-overlapping slice of byte ranges the lexer must treat as if they do not exist — blockquote > markers and list-item continuation indentation on continuation lines. Math regions may cross transparent runs (they are not region boundaries the way exclusion zones are); the runs are recorded on each body so MathBody::as_str can yield clean math content.