Merge pull request #4029 from thelounge/xpaw/emoji-dahes
Replace dashes to underscores in emoji autocompletion
This commit is contained in:
commit
2d88ae7503
@ -613,7 +613,7 @@
|
||||
"dragon_face": "🐲",
|
||||
"dragon": "🐉",
|
||||
"sauropod": "🦕",
|
||||
"t-rex": "🦖",
|
||||
"t_rex": "🦖",
|
||||
"whale": "🐳",
|
||||
"whale2": "🐋",
|
||||
"dolphin": "🐬",
|
||||
@ -1082,7 +1082,7 @@
|
||||
"game_die": "🎲",
|
||||
"jigsaw": "🧩",
|
||||
"teddy_bear": "🧸",
|
||||
"pi_ata": "🪅",
|
||||
"pinata": "🪅",
|
||||
"nesting_dolls": "🪆",
|
||||
"spades": "♠️",
|
||||
"hearts": "♥️",
|
||||
@ -1240,7 +1240,7 @@
|
||||
"chart": "💹",
|
||||
"email": "✉️",
|
||||
"envelope": "✉️",
|
||||
"e-mail": "📧",
|
||||
"e_mail": "📧",
|
||||
"incoming_envelope": "📨",
|
||||
"envelope_with_arrow": "📩",
|
||||
"outbox_tray": "📤",
|
||||
@ -1376,7 +1376,7 @@
|
||||
"no_bicycles": "🚳",
|
||||
"no_smoking": "🚭",
|
||||
"do_not_litter": "🚯",
|
||||
"non-potable_water": "🚱",
|
||||
"non_potable_water": "🚱",
|
||||
"no_pedestrians": "🚷",
|
||||
"no_mobile_phones": "📵",
|
||||
"underage": "🔞",
|
||||
|
@ -19,7 +19,14 @@ const emojiModifiersRegex = /[\u{1f3fb}-\u{1f3ff}]|\u{fe0f}/gu;
|
||||
const cleanEmoji = emoji.emoji.replace(emojiModifiersRegex, "");
|
||||
fullNameEmojiMap[cleanEmoji] = emoji.description;
|
||||
|
||||
for (const alias of emoji.aliases) {
|
||||
for (let alias of emoji.aliases) {
|
||||
if (alias !== "-1") {
|
||||
// Replace dashes to underscores except for :-1:
|
||||
// This removes autocompletion prompt for :-P
|
||||
// prompting for :non-potable_water:
|
||||
alias = alias.replace(/-/g, "_");
|
||||
}
|
||||
|
||||
emojiMap[alias] = emoji.emoji;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user