mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
look for aliases in Emoji.lookup_unicode
This commit is contained in:
parent
09d34b7642
commit
2aae6cfdbe
@ -144,11 +144,20 @@ class Emoji
|
||||
def self.lookup_unicode(name)
|
||||
@reverse_map ||= begin
|
||||
map = {}
|
||||
|
||||
db['emojis'].each do |e|
|
||||
next if e['name'] == 'tm'
|
||||
code = replacement_code(e['code'])
|
||||
map[e['name']] = code if code
|
||||
end
|
||||
|
||||
Emoji.aliases.each do |key, alias_names|
|
||||
next unless alias_code = map[key]
|
||||
alias_names.each do |alias_name|
|
||||
map[alias_name] = alias_code
|
||||
end
|
||||
end
|
||||
|
||||
map
|
||||
end
|
||||
@reverse_map[name]
|
||||
|
Loading…
Reference in New Issue
Block a user