Skip to main content

convert_for_dollar

Function convert_for_dollar 

Source
pub fn convert_for_dollar<'a>(
    source: &'a str,
    range: &Range<usize>,
    span: &MathSpan,
) -> Cow<'a, str>
Expand description

Rewrite the source bytes of a math region to dollar delimiters.

range is the outer byte range (delimiters + body, in source). span is the scanner-tagged classification.

The body is read through super::span::MathBody::as_str, which already strips container prefixes (blockquote >, list-item continuation indentation). Hand-slicing the source and stripping the delimiters here would re-do that work and silently break for container-nested math.