From cb16b0f8bec1a86530db2a45183bd4381422df21 Mon Sep 17 00:00:00 2001 From: t8y2 Date: Fri, 25 Sep 2026 12:45:40 +0800 Subject: [PATCH] fix(updates): hide HTML comment markers in release notes --- apps/desktop/src/components/layout/UpdateDialog.spec.ts | 9 +++++++++ apps/desktop/src/components/layout/UpdateDialog.vue | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/components/layout/UpdateDialog.spec.ts b/apps/desktop/src/components/layout/UpdateDialog.spec.ts index bfaa95c286..3c5bc1d886 100644 --- a/apps/desktop/src/components/layout/UpdateDialog.spec.ts +++ b/apps/desktop/src/components/layout/UpdateDialog.spec.ts @@ -402,6 +402,15 @@ describe("UpdateDialog release notes safety", () => { expect(document.body.querySelector("script, img")).toBeNull(); expect(Array.from(document.body.querySelectorAll("a")).every((anchor) => anchor.href.startsWith("https://"))).toBe(true); }); + + it("hides HTML comments such as the CNB mirror marker instead of rendering them as text", async () => { + await mountDialog(0, { releaseNotes: "### 安装\n- 条目\n\n\n> 国内下载:[CNB 镜像](https://cnb.cool/dbxio.com/dbx/-/releases)" }); + await vi.waitFor(() => { + expect(document.body.querySelector('a[href^="https://cnb.cool"]')).not.toBeNull(); + }); + expect(document.body.textContent).not.toContain("dbx-cnb-mirror"); + expect(document.body.textContent).not.toContain("/g, "")) as string; }, { immediate: true }, );