diff --git a/crates/math/src/latex_text.rs b/crates/math/src/latex_text.rs index dee0a4ee67..5541a36c39 100644 --- a/crates/math/src/latex_text.rs +++ b/crates/math/src/latex_text.rs @@ -205,7 +205,7 @@ fn math_symbol(name: &str) -> Option { /// For every `l` in `chars`, the index of the `r` that closes it, found in one stack pass. /// Looking groups up here keeps scanning linear: rescanning to the end of the input for every /// unmatched `(` made long equations quadratic. -pub(super) fn closers(chars: &[char], l: char, r: char) -> Vec> { +pub fn closers(chars: &[char], l: char, r: char) -> Vec> { let mut out = vec![None; chars.len()]; let mut open = Vec::new(); for (i, c) in chars.iter().enumerate() { @@ -222,7 +222,7 @@ pub(super) fn closers(chars: &[char], l: char, r: char) -> Vec> { } /// The balanced group opening at `open` (see [`closers`]): its content and the index after it. -pub(super) fn balanced(chars: &[char], closers: &[Option], open: usize) -> Option<(String, usize)> { +pub fn balanced(chars: &[char], closers: &[Option], open: usize) -> Option<(String, usize)> { let close = (*closers.get(open)?)?; Some((chars.get(open + 1..close).unwrap_or_default().iter().collect(), close + 1)) }