diff --git a/crates/typst/src/math/fragment.rs b/crates/typst/src/math/fragment.rs index 63c42cbce..da4cb0adc 100644 --- a/crates/typst/src/math/fragment.rs +++ b/crates/typst/src/math/fragment.rs @@ -120,17 +120,18 @@ impl MathFragment { } pub fn is_spaced(&self) -> bool { - self.class() == MathClass::Fence - || match self { - MathFragment::Frame(frame) => { - frame.spaced - && matches!( - frame.class, - MathClass::Normal | MathClass::Alphabetic - ) - } - _ => false, - } + if self.class() == MathClass::Fence { + return true; + } + + matches!( + self, + MathFragment::Frame(FrameFragment { + spaced: true, + class: MathClass::Normal | MathClass::Alphabetic, + .. + }) + ) } pub fn is_text_like(&self) -> bool {