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())
|
||||
}
|
||||
}
|
||||
|
||||
|
BIN
tests/ref/math/prime.png
Normal file
BIN
tests/ref/math/prime.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
9
tests/typ/math/prime.typ
Normal file
9
tests/typ/math/prime.typ
Normal file
@ -0,0 +1,9 @@
|
||||
// Test prime symbols after code mode.
|
||||
#let g = $f$
|
||||
#let gg = $f$
|
||||
|
||||
$
|
||||
#(g)' #g' #g ' \
|
||||
#g''''''''''''''''' \
|
||||
gg'
|
||||
$
|
Loading…
x
Reference in New Issue
Block a user