diff options
Diffstat (limited to 'crates/typst-syntax/src')
| -rw-r--r-- | crates/typst-syntax/src/ast.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/typst-syntax/src/ast.rs b/crates/typst-syntax/src/ast.rs index 83e4ff9c..f411326f 100644 --- a/crates/typst-syntax/src/ast.rs +++ b/crates/typst-syntax/src/ast.rs @@ -863,7 +863,11 @@ impl<'a> MathAttach<'a> { /// Extract attached primes if present. pub fn primes(self) -> Option<MathPrimes<'a>> { - self.0.children().nth(1).and_then(|n| n.cast()) + self.0 + .children() + .skip_while(|node| node.cast::<Expr<'_>>().is_none()) + .nth(1) + .and_then(|n| n.cast()) } } |
