From d7c46a002f58ae92d981db48fef90282174b07fb Mon Sep 17 00:00:00 2001 From: ChaosExAnima Date: Thu, 25 Sep 2025 14:17:46 +0200 Subject: [PATCH] lazy-loads images, re-adds colons for custom emoji --- app/javascript/mastodon/components/emoji/index.tsx | 2 ++ app/javascript/mastodon/features/emoji/render.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/emoji/index.tsx b/app/javascript/mastodon/components/emoji/index.tsx index d9e3bde98b6..e4a8a905099 100644 --- a/app/javascript/mastodon/components/emoji/index.tsx +++ b/app/javascript/mastodon/components/emoji/index.tsx @@ -66,6 +66,7 @@ export const Emoji: FC = ({ alt={shortcode} title={shortcode} className='emojione custom-emoji' + loading='lazy' /> ); } @@ -78,6 +79,7 @@ export const Emoji: FC = ({ alt={state.data.unicode} title={state.data.label} className='emojione' + loading='lazy' /> ); }; diff --git a/app/javascript/mastodon/features/emoji/render.ts b/app/javascript/mastodon/features/emoji/render.ts index 07dd919da9f..543c8985dc7 100644 --- a/app/javascript/mastodon/features/emoji/render.ts +++ b/app/javascript/mastodon/features/emoji/render.ts @@ -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