Skip to main content

is_in_math_context

Function is_in_math_context 

Source
pub fn is_in_math_context(ctx: &LintContext<'_>, byte_pos: usize) -> bool
Expand description

Check if a byte position is within a math context.

$$...$$ display math is recognized only when it begins its line, via [math_block_ranges]; a mid-line or stray-prose $$...$$ is a literal, not math. Single-$ inline spans are recognized anywhere. This keeps every math-aware rule agreeing on what is math.