mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-09 23:16:50 +02:00
fix: serialize unicode emoji as actual characters, not shortcodes
When sending messages: - Unicode emoji (😄, 🔥) → outputs 😄, 🔥 (the actual character) - Custom emoji (:pepe:) → outputs :pepe: with emoji tag for rendering
This commit is contained in:
@@ -335,15 +335,14 @@ export const MentionEditor = forwardRef<
|
||||
const url = child.attrs?.url;
|
||||
const source = child.attrs?.source;
|
||||
|
||||
if (shortcode) {
|
||||
if (source === "unicode" && url) {
|
||||
// Unicode emoji - output the actual character
|
||||
text += url;
|
||||
} else if (shortcode) {
|
||||
// Custom emoji - output :shortcode: and add tag
|
||||
text += `:${shortcode}:`;
|
||||
|
||||
// Only add emoji tag for custom emojis (not unicode)
|
||||
if (
|
||||
url &&
|
||||
source !== "unicode" &&
|
||||
!seenEmojis.has(shortcode)
|
||||
) {
|
||||
if (url && !seenEmojis.has(shortcode)) {
|
||||
seenEmojis.add(shortcode);
|
||||
emojiTags.push({ shortcode, url });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user