diff --git a/internal_packages/composer-emoji/lib/emoji-composer-extension.jsx b/internal_packages/composer-emoji/lib/emoji-composer-extension.jsx index febf61c02..33963ad10 100644 --- a/internal_packages/composer-emoji/lib/emoji-composer-extension.jsx +++ b/internal_packages/composer-emoji/lib/emoji-composer-extension.jsx @@ -133,7 +133,7 @@ class EmojiComposerExtension extends ComposerExtension { static applyTransformsToDraft = ({draft}) => { const nextDraft = draft.clone(); - nextDraft.body = nextDraft.body.replace(/.*<\/span>/g, (match, emojiName) => + nextDraft.body = nextDraft.body.replace(//g, (match, emojiName) => `${emoji.get(emojiName)}` ); return nextDraft; @@ -141,8 +141,8 @@ class EmojiComposerExtension extends ComposerExtension { static unapplyTransformsToDraft = ({draft}) => { const nextDraft = draft.clone(); - nextDraft.body = nextDraft.body.replace(/.*<\/span>/g, (match, emojiName) => - `` + nextDraft.body = nextDraft.body.replace(/[^<]+<\/span>/g, (match, emojiName) => + `` ); return nextDraft; } @@ -206,11 +206,12 @@ class EmojiComposerExtension extends ComposerExtension { } const emojiChar = emoji.get(emojiName); if (process.platform === "darwin" && missingEmojiList.indexOf(emojiName) !== -1) { - const html = ``; + style="margin-top: -5px;">`; editor.insertHTML(html, {selectInsertion: false}); } else { editor.insertText(emojiChar);