From 60f0e6ff6a98aa63c8919c89025e26fe1972e668 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 24 Sep 2023 14:48:38 -0500 Subject: [PATCH] Disable EmojiNode for now :( --- .../compose/editor/plugins/autosuggest-plugin.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/features/compose/editor/plugins/autosuggest-plugin.tsx b/src/features/compose/editor/plugins/autosuggest-plugin.tsx index 523954c28..6bd831c5a 100644 --- a/src/features/compose/editor/plugins/autosuggest-plugin.tsx +++ b/src/features/compose/editor/plugins/autosuggest-plugin.tsx @@ -39,7 +39,6 @@ import { selectAccount } from 'soapbox/selectors'; import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions'; import AutosuggestAccount from '../../components/autosuggest-account'; -import { $createEmojiNode } from '../nodes/emoji-node'; import type { AutoSuggestion } from 'soapbox/components/autosuggest-input'; @@ -315,16 +314,7 @@ const AutosuggestPlugin = ({ if (isNativeEmoji(suggestion)) { node.spliceText(leadOffset - 1, matchingString.length, `${suggestion.native} `, true); } else { - const completion = suggestion.colons; - - let emojiText; - - if (leadOffset === 1) emojiText = node; - else [, emojiText] = node.splitText(leadOffset - 1); - - [emojiText] = emojiText.splitText(matchingString.length); - - emojiText?.replace($createEmojiNode(completion, suggestion.imageUrl)); + node.spliceText(leadOffset - 1, matchingString.length, `${suggestion.colons} `, true); } } else if (suggestion[0] === '#') { node.setTextContent(`${suggestion} `);