mirror of https://github.com/stelzo/typst.git
MathAttach::primes: account for possible hash before base (#2363)
Fixes #2358.
This commit is contained in:
parent
d1a702f3fd
commit
d3b62bd02e
|
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -0,0 +1,9 @@
|
|||
// Test prime symbols after code mode.
|
||||
#let g = $f$
|
||||
#let gg = $f$
|
||||
|
||||
$
|
||||
#(g)' #g' #g ' \
|
||||
#g''''''''''''''''' \
|
||||
gg'
|
||||
$
|
||||
Loading…
Reference in New Issue