Fix single prime in subscript (#1909)

* Fix single prime in subscript (a_' producing wrong result)

* Clippy
This commit is contained in:
sitandr 2023-08-10 22:36:05 +03:00 committed by GitHub
parent 88bcb8769a
commit 2f81089995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -848,9 +848,9 @@ impl MathAttach {
.find_map(SyntaxNode::cast)
}
/// Extract primes if present.
/// Extract attached primes if present.
pub fn primes(&self) -> Option<MathPrimes> {
self.0.cast_first_match()
self.0.children().nth(1).and_then(|n| n.cast())
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -43,3 +43,7 @@ $a'_b^c$, $a_b'^c$, $a_b^c'$, $a_b'^c'^d'$
$(a'_b')^(c'_d')$, $a'/b'$, $a_b'/c_d'$
$∫'$, $∑'$, $ ∑'_S' $
---
// Test attaching primes only
$a' = a^', a_', a_'''^''^'$