Skip to content

Commit 496f10a

Browse files
committed
Keep custom emojis inline next to display names
The new design system applies "img { display: block }" as part of the UnoCSS Wind4 reset to avoid baseline gaps under stand- alone images, so the inline <img> emitted by renderCustomEmojis broke onto its own line whenever a display name carried a custom emoji like ":nonbinary:". This was visible on the profile header, the public home page, the account list, and on every post in the timeline. Render the emoji image with an inline style of "display: inline-block; height: 1em; vertical-align: -0.125em" so it sits beside the surrounding text and rests on the baseline of the run. Assisted-by: Claude Code:claude-opus-4-7
1 parent 71dd980 commit 496f10a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/custom-emoji.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function renderCustomEmojis(
3535
return input.replaceAll(CUSTOM_EMOJI_REGEXP, (match) => {
3636
const emoji = emojis[match] ?? emojis[match.replace(/^:|:$/g, "")];
3737
if (emoji == null) return match;
38-
return `<img src="${emoji}" alt="${match}" style="height: 1em">`;
38+
return `<img src="${emoji}" alt="${match}" style="display: inline-block; height: 1em; vertical-align: -0.125em">`;
3939
});
4040
}
4141
}

0 commit comments

Comments
 (0)