From 241c824ab54182c4cbaeccf33c9475c4652b14c0 Mon Sep 17 00:00:00 2001 From: Lhcfl Date: Sun, 14 Apr 2024 16:44:12 +0800 Subject: [PATCH] fix: use better `]]>` replacer --- packages/backend/src/server/web/feed.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/backend/src/server/web/feed.ts b/packages/backend/src/server/web/feed.ts index 3b1b9d6fa5..f3b3c97c32 100644 --- a/packages/backend/src/server/web/feed.ts +++ b/packages/backend/src/server/web/feed.ts @@ -8,12 +8,9 @@ import getNoteHtml from "@/remote/activitypub/misc/get-note-html.js"; /** * If there is this part in the note, it will cause CDATA to be terminated early. - * So I inserted two zero-width spaces in the middle, which doesn't make a visual difference - * Although this is not a good solution, there seems no other way. - * Anyway, it is not common to encounter such extreme situations. */ function escapeCDATA(str: string) { - return str.replaceAll("]]>", "]​]​>"); + return str.replaceAll("]]>", "]]]]>"); } export default async function (