lazy-loads images, re-adds colons for custom emoji
Some checks are pending
Chromatic / Run Chromatic (push) Waiting to run

This commit is contained in:
ChaosExAnima 2025-09-25 14:17:46 +02:00
parent 84f3b60b4f
commit d7c46a002f
No known key found for this signature in database
GPG Key ID: 8F2B333100FB6117
2 changed files with 3 additions and 1 deletions

View File

@ -66,6 +66,7 @@ export const Emoji: FC<EmojiProps> = ({
alt={shortcode}
title={shortcode}
className='emojione custom-emoji'
loading='lazy'
/>
);
}
@ -78,6 +79,7 @@ export const Emoji: FC<EmojiProps> = ({
alt={state.data.unicode}
title={state.data.label}
className='emojione'
loading='lazy'
/>
);
};

View File

@ -318,7 +318,7 @@ export function tokenizeText(text: string): TokenizedText {
// Custom emoji
tokens.push({
type: EMOJI_TYPE_CUSTOM,
code: code.slice(1, -1), // Remove the colons
code,
} satisfies CustomEmojiToken);
} else {
// Unicode emoji