Skip to content

Commit 3dafd1c

Browse files
committed
turn mtext that looks like a number into an ms
1 parent ea94de0 commit 3dafd1c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/canonicalize.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,10 @@ impl CanonicalizeContext {
905905
// people tend to set them in a non-italic font and software makes that 'mtext'
906906
CanonicalizeContext::make_roman_numeral(mathml);
907907
return Some(mathml);
908+
} else if text.chars().all(|c| c.is_ascii_digit() || matches!(c, '.' | ',' | ' ' | '\u{00A0}')) &&
909+
text.chars().any(|c| c.is_ascii_digit()){ // does it look like a number?
910+
mathml.set_name("mn");
911+
return Some(mathml);
908912
} else if contains_currency(text) && let Some(result) = split_currency_symbol(mathml) {
909913
return Some(result);
910914
}

0 commit comments

Comments
 (0)