From a8b2fea86e044e1db7a89d44c1a8faf8080ef1ec Mon Sep 17 00:00:00 2001 From: Aditya Garud Date: Mon, 18 May 2026 00:24:13 +0530 Subject: [PATCH] fix(app): normalize escaped newlines in release notes --- .../domains/settings/state/electron-updater-state.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/app/src/react-app/domains/settings/state/electron-updater-state.ts b/apps/app/src/react-app/domains/settings/state/electron-updater-state.ts index 00c2af5a8..d7204879c 100644 --- a/apps/app/src/react-app/domains/settings/state/electron-updater-state.ts +++ b/apps/app/src/react-app/domains/settings/state/electron-updater-state.ts @@ -65,14 +65,18 @@ function describeError(error: unknown) { return serialized && serialized !== "{}" ? serialized : String(error); } +function normalizeReleaseNotes(value: string): string { + return value.replace(/\\r\\n|\\n/g, "\n"); +} + function releaseNotesToText(value: unknown): string | undefined { - if (typeof value === "string") return value; + if (typeof value === "string") return normalizeReleaseNotes(value); if (Array.isArray(value)) { return value .flatMap((entry) => { - if (typeof entry === "string") return entry; + if (typeof entry === "string") return normalizeReleaseNotes(entry); if (entry && typeof entry === "object" && "note" in entry) { - const note = String((entry as { note?: unknown }).note ?? ""); + const note = normalizeReleaseNotes(String((entry as { note?: unknown }).note ?? "")); return note ? [note] : []; } return [];