mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
fix(emoji): Remove special casing for Outlook emoji
This commit is contained in:
parent
10ac3fcb30
commit
2f7d64b27a
1 changed files with 1 additions and 20 deletions
|
@ -18,26 +18,7 @@ class EmojiMessageExtension extends MessageViewExtension {
|
|||
static renderedMessageBodyIntoDocument({document}) {
|
||||
const emojiRegex = RegExpUtils.emojiRegex();
|
||||
|
||||
// special case: Find outlook-style emoji, where it's an image with an emoji alt-text.
|
||||
// <img alt="😊" class="EmojiInsert">
|
||||
const emojiImageTags = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT, {
|
||||
acceptNode: (node) => {
|
||||
if ((node.nodeName === 'IMG') && node.alt) {
|
||||
return NodeFilter.FILTER_ACCEPT;
|
||||
}
|
||||
return NodeFilter.FILTER_SKIP;
|
||||
},
|
||||
});
|
||||
|
||||
while (emojiImageTags.nextNode()) {
|
||||
const node = emojiImageTags.currentNode;
|
||||
const emojiNameForAlt = emoji.which(node.alt);
|
||||
if (emojiNameForAlt) {
|
||||
makeIntoEmojiTag(node, emojiNameForAlt);
|
||||
}
|
||||
}
|
||||
|
||||
// general case: look for emoji in the content of text nodes
|
||||
// Look for emoji in the content of text nodes
|
||||
const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
||||
|
||||
while (treeWalker.nextNode()) {
|
||||
|
|
Loading…
Reference in a new issue