fix(ui): preserve ZWJ in emoji sanitization
This commit is contained in:
parent
a0575539a0
commit
dd874d52f6
@ -145,4 +145,8 @@ describe("resolveAgentEmoji", () => {
|
||||
it("falls back to empty for control-only emoji strings", () => {
|
||||
expect(resolveAgentEmoji({ identity: { emoji: "\u202E\u2066" } })).toBe("");
|
||||
});
|
||||
|
||||
it("preserves ZWJ-composed compound emoji intact", () => {
|
||||
expect(resolveAgentEmoji({ identity: { emoji: "👩💻" } })).toBe("👩💻");
|
||||
});
|
||||
});
|
||||
|
||||
@ -221,7 +221,7 @@ export function agentLogoUrl(basePath: string): string {
|
||||
return base ? `${base}/favicon.svg` : "favicon.svg";
|
||||
}
|
||||
|
||||
const EMOJI_CONTROL_CHARS_RE = /[\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;
|
||||
const EMOJI_CONTROL_CHARS_RE = /[\u200B\u200C\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;
|
||||
|
||||
function sanitizeEmojiValue(value: string): string {
|
||||
const cleaned = value.replaceAll(EMOJI_CONTROL_CHARS_RE, "").trim();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user