From 270117ee7d1129926e8264fd54e306adf06b1376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Fri, 15 May 2026 11:06:54 +0200 Subject: [PATCH] Escape emoji character in twemoji alt attribute --- src/lib/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index d27c8fc26..1d21dfe1e 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -5,6 +5,7 @@ import type { Review } from "@bindings/cob/patch/Review"; import type { ComponentProps } from "svelte"; import bs58 from "bs58"; +import escape from "lodash/escape.js"; import md5 from "md5"; import twemojiModule from "twemoji"; @@ -150,7 +151,7 @@ export function emojiToTwemoji(emoji: string, exclude?: string[]) { if (!filename || exclude?.includes(filename)) { return ""; } - return `${emoji}`; + return `${escape(emoji)}`; } export function scrollIntoView(id: string, options?: ScrollIntoViewOptions) {