mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-06 00:52:42 +00:00
lazy-loads images, re-adds colons for custom emoji
Some checks are pending
Chromatic / Run Chromatic (push) Waiting to run
Some checks are pending
Chromatic / Run Chromatic (push) Waiting to run
This commit is contained in:
parent
84f3b60b4f
commit
d7c46a002f
|
@ -66,6 +66,7 @@ export const Emoji: FC<EmojiProps> = ({
|
||||||
alt={shortcode}
|
alt={shortcode}
|
||||||
title={shortcode}
|
title={shortcode}
|
||||||
className='emojione custom-emoji'
|
className='emojione custom-emoji'
|
||||||
|
loading='lazy'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -78,6 +79,7 @@ export const Emoji: FC<EmojiProps> = ({
|
||||||
alt={state.data.unicode}
|
alt={state.data.unicode}
|
||||||
title={state.data.label}
|
title={state.data.label}
|
||||||
className='emojione'
|
className='emojione'
|
||||||
|
loading='lazy'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -318,7 +318,7 @@ export function tokenizeText(text: string): TokenizedText {
|
||||||
// Custom emoji
|
// Custom emoji
|
||||||
tokens.push({
|
tokens.push({
|
||||||
type: EMOJI_TYPE_CUSTOM,
|
type: EMOJI_TYPE_CUSTOM,
|
||||||
code: code.slice(1, -1), // Remove the colons
|
code,
|
||||||
} satisfies CustomEmojiToken);
|
} satisfies CustomEmojiToken);
|
||||||
} else {
|
} else {
|
||||||
// Unicode emoji
|
// Unicode emoji
|
||||||
|
|
Loading…
Reference in New Issue
Block a user