mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Escape emoji character in twemoji alt attribute
This commit is contained in:
+2
-1
@@ -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 `<img alt="${emoji}" src="/twemoji/${filename}.svg" class="txt-emoji">`;
|
||||
return `<img alt="${escape(emoji)}" src="/twemoji/${filename}.svg" class="txt-emoji">`;
|
||||
}
|
||||
|
||||
export function scrollIntoView(id: string, options?: ScrollIntoViewOptions) {
|
||||
|
||||
Reference in New Issue
Block a user