Handle optval when translating names.
This commit is contained in:
parent
b1a0fa4acf
commit
51429e3155
@ -103,12 +103,16 @@ pub(crate) fn parse_affiliated_keywords<'g, 's>(
|
||||
}
|
||||
|
||||
fn translate_name<'g, 's>(global_settings: &'g GlobalSettings<'g, 's>, name: &'s str) -> String {
|
||||
let name_until_optval = name
|
||||
.split_once("[")
|
||||
.map(|(before, _after)| before)
|
||||
.unwrap_or(name);
|
||||
for (src, dst) in global_settings.element_keyword_translation_alist {
|
||||
if name.eq_ignore_ascii_case(src) {
|
||||
if name_until_optval.eq_ignore_ascii_case(src) {
|
||||
return dst.to_lowercase();
|
||||
}
|
||||
}
|
||||
name.to_lowercase()
|
||||
name_until_optval.to_lowercase()
|
||||
}
|
||||
|
||||
fn is_single_string_keyword<'g, 's>(
|
||||
|
Loading…
Reference in New Issue
Block a user