emoji: Remove parens and apostrophes from emoji names.

This was breaking rendering of the emoji with these names.
More context on CZO: https://chat.zulip.org/#narrow/stream/9-issues/topic/issue.20with.20built-in.20emoji.20name/near/1517735
This commit is contained in:
evykassirer 2023-03-23 14:48:32 -07:00 committed by Tim Abbott
parent b2c048f172
commit 12a61fcec6
2 changed files with 8 additions and 5 deletions

View File

@ -73,12 +73,12 @@ EMOJI_NAME_MAPS: Dict[str, Dict[str, Any]] = {
"1f1e7-1f1fe": {"canonical_name": "flag_belarus", "aliases": []},
"1f1e7-1f1ff": {"canonical_name": "flag_belize", "aliases": []},
"1f1e8-1f1e6": {"canonical_name": "flag_canada", "aliases": []},
"1f1e8-1f1e8": {"canonical_name": "flag_cocos_(keeling)_islands", "aliases": []},
"1f1e8-1f1e8": {"canonical_name": "flag_cocos_keeling_islands", "aliases": []},
"1f1e8-1f1e9": {"canonical_name": "flag_congo_kinshasa", "aliases": []},
"1f1e8-1f1eb": {"canonical_name": "flag_central_african_republic", "aliases": []},
"1f1e8-1f1ec": {"canonical_name": "flag_congo_brazzaville", "aliases": []},
"1f1e8-1f1ed": {"canonical_name": "flag_switzerland", "aliases": []},
"1f1e8-1f1ee": {"canonical_name": "flag_côte_d'ivoire", "aliases": ["flag_cote_d'ivoire"]},
"1f1e8-1f1ee": {"canonical_name": "flag_côte_divoire", "aliases": ["flag_cote_divoire"]},
"1f1e8-1f1f0": {"canonical_name": "flag_cook_islands", "aliases": []},
"1f1e8-1f1f1": {"canonical_name": "flag_chile", "aliases": []},
"1f1e8-1f1f2": {"canonical_name": "flag_cameroon", "aliases": []},
@ -188,7 +188,7 @@ EMOJI_NAME_MAPS: Dict[str, Dict[str, Any]] = {
"1f1f2-1f1ed": {"canonical_name": "flag_marshall_islands", "aliases": []},
"1f1f2-1f1f0": {"canonical_name": "flag_north_macedonia", "aliases": []},
"1f1f2-1f1f1": {"canonical_name": "flag_mali", "aliases": []},
"1f1f2-1f1f2": {"canonical_name": "flag_myanmar_(burma)", "aliases": []},
"1f1f2-1f1f2": {"canonical_name": "flag_myanmar_burma", "aliases": []},
"1f1f2-1f1f3": {"canonical_name": "flag_mongolia", "aliases": []},
"1f1f2-1f1f4": {"canonical_name": "flag_macao_sar_china", "aliases": []},
"1f1f2-1f1f5": {"canonical_name": "flag_northern_mariana_islands", "aliases": []},

View File

@ -80,9 +80,12 @@ def cleanup_name(name: str) -> str:
":": "",
".": "",
",": "",
"(": "",
")": "",
"&": "and",
"": "'",
"": "'",
"": "",
"": "",
"'": "",
}
for before, after in replacements.items():
name = name.replace(before, after)