mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
dcb8478f97
Summary: The emoji picker allows users to insert emoji to their messages on click. A few emoji that don't render properly in Chromium are replaced with PNGs, both in the composer view and the message list view, but only the Unicode characters are sent in the message bodies. Test Plan: TODO Reviewers: bengotow, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D2787
12 lines
498 B
JavaScript
12 lines
498 B
JavaScript
import {MessageViewExtension} from 'nylas-exports';
|
|
|
|
|
|
class EmojiMessageExtension extends MessageViewExtension {
|
|
static formatMessageBody({message}) {
|
|
message.body = message.body.replace(/<span class="broken-emoji ([a-zA-Z0-9-_]*)">.*<\/span>/g, (match, emojiName) =>
|
|
`<span class="missing-emoji ${emojiName}"><img src="images/composer-emoji/missing-emoji/${emojiName}.png" width="14" height="14" style="margin-top: -5px;" /></span>`
|
|
);
|
|
}
|
|
}
|
|
|
|
export default EmojiMessageExtension;
|