Commit 1335a96d authored by JC Brand's avatar JC Brand

Bugfix. Handle emojis for which we don't have shortnames

parent 0da80671
...@@ -120,7 +120,7 @@ export function getEmojiMarkup (data, options={unicode_only: false, add_title_wr ...@@ -120,7 +120,7 @@ export function getEmojiMarkup (data, options={unicode_only: false, add_title_wr
const shortname = data.shortname; const shortname = data.shortname;
if (emoji) { if (emoji) {
if (api.settings.get('use_system_emojis')) { if (api.settings.get('use_system_emojis')) {
return options.add_title_wrapper ? html`<span title="${shortname}">${emoji}</span>` : emoji; return (options.add_title_wrapper && shortname) ? html`<span title="${shortname}">${emoji}</span>` : emoji;
} else { } else {
const path = api.settings.get('emoji_image_path'); const path = api.settings.get('emoji_image_path');
return html`<img class="emoji" return html`<img class="emoji"
...@@ -173,7 +173,7 @@ export function getCodePointReferences (text) { ...@@ -173,7 +173,7 @@ export function getCodePointReferences (text) {
'cp': icon_id, 'cp': icon_id,
'emoji': emoji, 'emoji': emoji,
'end': offset + emoji.length, 'end': offset + emoji.length,
'shortname': u.getEmojisByAtrribute('cp')[icon_id]['sn'], 'shortname': u.getEmojisByAtrribute('cp')[icon_id]?.sn || ''
}); });
}); });
return references; return references;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment