Skip to content

Commit 6c52fc8

Browse files
committed
exclude °C and °F from PSEUDO_SCRIPT in mi's
1 parent 5773d44 commit 6c52fc8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/canonicalize.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,9 +1389,13 @@ impl CanonicalizeContext {
13891389

13901390
/// looks for pairs of (letter, pseudoscript) such as x' or p'q' all inside of a single token element
13911391
fn split_apart_pseudo_scripts<'a>(mi: Element<'a>) -> Option<Element<'a>> {
1392+
lazy_static!{
1393+
static ref IS_DEGREES_C_or_F: Regex = Regex::new(r"[°º][CF]").unwrap();
1394+
}
1395+
13921396
let text = as_text(mi);
13931397
debug!("split_apart_pseudo_scripts: start text=\"{text}\"");
1394-
if !text.chars().any (|c| PSEUDO_SCRIPTS.contains(&c)) {
1398+
if !text.chars().any(|c| PSEUDO_SCRIPTS.contains(&c)) || IS_DEGREES_C_or_F.is_match(text) {
13951399
return None;
13961400
}
13971401

0 commit comments

Comments
 (0)