mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
13 lines
498 B
React
13 lines
498 B
React
|
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;
|