Sync the new combining accents added in PR #2218 (#3069)

This commit is contained in:
Leedehai 2024-01-03 04:37:20 -05:00 committed by GitHub
parent ae3aac27d3
commit 155af2318e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -45,15 +45,17 @@ pub struct AccentElem {
/// | Macron | `macron` | `¯` |
/// | Breve | `breve` | `˘` |
/// | Dot | `dot` | `.` |
/// | Double dot | `dot.double` | `¨` |
/// | Double dot, Diaeresis | `dot.double`, `diaer` | `¨` |
/// | Triple dot | `dot.triple` | <code>&tdot;</code> |
/// | Quadruple dot | `dot.quad` | <code>&DotDot;</code> |
/// | Diaeresis | `diaer` | `¨` |
/// | Circle | `circle` | `∘` |
/// | Double acute | `acute.double` | `˝` |
/// | Caron | `caron` | `ˇ` |
/// | Right arrow | `arrow`, `->` | `→` |
/// | Left arrow | `arrow.l`, `<-` | `←` |
/// | Left/Right arrow | `arrow.l.r` | `↔` |
/// | Right harpoon | `harpoon` | `⇀` |
/// | Left harpoon | `harpoon.lt` | `↼` |
#[required]
pub accent: Accent,

View File

@ -134,7 +134,8 @@ impl Symbol {
set.into_iter()
}
/// Normalize an accent to a combining one.
/// Normalize an accent to a combining one. Keep it synced with the
/// documenting table in accent.rs AccentElem.
pub fn combining_accent(c: char) -> Option<char> {
Some(match c {
'\u{0300}' | '`' => '\u{0300}',
@ -153,9 +154,9 @@ impl Symbol {
'\u{030c}' | 'ˇ' => '\u{030c}',
'\u{20d6}' | '←' => '\u{20d6}',
'\u{20d7}' | '→' | '⟶' => '\u{20d7}',
'\u{20e1}' | '↔' | '⟷' => '\u{20e1}',
'\u{20d0}' | '↼' => '\u{20d0}',
'\u{20d1}' | '⇀' => '\u{20d1}',
'\u{20e1}' | '↔' | '⟷' => '\u{20e1}',
_ => return None,
})
}