Skip to content

fix: convert all emoji shortnames in message text - #1401

Open
swarnendusahu10-dotcom wants to merge 1 commit into
RocketChat:developfrom
swarnendusahu10-dotcom:fix/issue-1315-parse-all-emojis
Open

swarnendusahu10-dotcom wants to merge 1 commit into
RocketChat:developfrom
swarnendusahu10-dotcom:fix/issue-1315-parse-all-emojis

Conversation

@swarnendusahu10-dotcom

@swarnendusahu10-dotcom swarnendusahu10-dotcom commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #1315.

Fixes an issue in parseEmoji where only the last emoji shortname in a message or attachment caption was converted to unicode, leaving all earlier shortnames unparsed.


Problem (Before)

In packages/react/src/lib/emoji.js, parseEmoji extracted all :shortname: matches using /g, but explicitly indexed only the final element in the array:

const result = regx_data[regx_data.length - 1]; // ⚠️ Throws away all preceding matches!
const d = emojione.shortnameToUnicode(result);
if (d !== undefined) text = text.replace(result, d);

This branch has not been deployed

No deployments
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.

Only the last emoji shortname in a message is converted to unicode

1 participant