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.
MathSpan::Environment: borrow source unchanged — there is no dollar form of\begin{name}…\end{name}.MathSpan::Inline: emit${body}$.MathSpan::Display: emit$$ {body} $$.
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.