summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst/src/math/fragment.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/crates/typst/src/math/fragment.rs b/crates/typst/src/math/fragment.rs
index 63c42cbc..da4cb0ad 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 {