Fix spacing after number in math

Fixes #1052
This commit is contained in:
Laurenz 2023-09-06 12:15:27 +02:00
parent fe402759c0
commit 65aeea3142
4 changed files with 10 additions and 1 deletions

View File

@ -190,7 +190,7 @@ impl<'a, 'b, 'v> MathContext<'a, 'b, 'v> {
} else {
glyph.into()
}
} else if text.chars().all(|c| c.is_ascii_digit()) {
} else if text.chars().all(|c| c.is_ascii_digit() || c == '.') {
// Numbers aren't that difficult.
let mut fragments = vec![];
for c in text.chars() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1,9 @@
// Test spacing after numbers in math.
---
$
10degree \
10 degree \
10.1degree \
10.1 degree
$