Skip to content

Fix: properly render emoji in usernames, mentions, and roles; restore role mention colors.#337

Open
ohmwraith wants to merge 3 commits intoMathMan05:mainfrom
ohmwraith:fix/restore-emoji-colors-in-nick
Open

Fix: properly render emoji in usernames, mentions, and roles; restore role mention colors.#337
ohmwraith wants to merge 3 commits intoMathMan05:mainfrom
ohmwraith:fix/restore-emoji-colors-in-nick

Conversation

@ohmwraith
Copy link
Copy Markdown

Description

Fixes incorrect emoji rendering in usernames, role names, and mentions by properly handling Unicode grapheme clusters.

Previously, emoji could inherit role background colors, resulting in incorrect appearance.

Also restores correct role mention colors.


Usage

A new utility function, setTextWithWrappedEmoji, replaces plain text rendering with grapheme-aware rendering.
It splits the string into grapheme clusters and wraps emoji in <span class="emoji">.

Use it wherever user-provided names or mentions are rendered (usernames, role names, channel mentions, etc.).


Notes

  • Supports complex emoji sequences (ZWJ, skin tone modifiers, flags, keycaps, etc.)
  • Intl.Segmenter is used for correct Unicode handling, falls back to the previous behavior in unsupported browsers.
  • Global account usernames are not affected, since they do not use role-based styling.

Chat

Before

image_2026-04-26_03-54-38

After

image_2026-04-26_03-45-36

Member List

Before After
image image

Server roles

Before After

@ohmwraith ohmwraith force-pushed the fix/restore-emoji-colors-in-nick branch from 79b8978 to 6ebc37f Compare April 26, 2026 16:42
@ohmwraith ohmwraith force-pushed the fix/restore-emoji-colors-in-nick branch from 6ebc37f to b6eca7e Compare April 26, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant