Merge branch 'lexical-fix-custom-emojis' into 'main'

lexical: fix custom emojis (add a text representation of them)

See merge request soapbox-pub/soapbox!2749
This commit is contained in:
Alex Gleason 2023-09-23 22:36:54 +00:00
commit 970ad24de9

View file

@ -61,8 +61,7 @@ class EmojiNode extends DecoratorNode<JSX.Element> {
}
static importJSON(serializedNode: SerializedEmojiNode): EmojiNode {
const { name, src } =
serializedNode;
const { name, src } = serializedNode;
const node = $createEmojiNode(name, src);
return node;
}
@ -84,6 +83,10 @@ class EmojiNode extends DecoratorNode<JSX.Element> {
return true;
}
getTextContent(): string {
return this.__name;
}
decorate(): JSX.Element {
return (
<Emoji src={this.__src} alt={this.__name} className='emojione h-4 w-4' />