From 56ee681aecdcef5726cb31a8288e8e680a785659 Mon Sep 17 00:00:00 2001 From: Sucukdeluxe Date: Thu, 5 Mar 2026 02:37:18 +0100 Subject: [PATCH] Strip markdown formatting from changelog in update dialog The confirm dialog is plain text and cannot render markdown. Strip headings, bold, italic, code backticks, and normalize list bullets. Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src/renderer/App.tsx | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 88b3095..cb9bd4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "real-debrid-downloader", - "version": "1.6.38", + "version": "1.6.39", "description": "Desktop downloader", "main": "build/main/main/main.js", "author": "Sucukdeluxe", diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 63d7755..5da1f9d 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -1001,7 +1001,16 @@ export function App(): ReactElement { } let changelogBlock = ""; if (result.releaseNotes) { - const notes = result.releaseNotes.length > 500 ? `${result.releaseNotes.slice(0, 500)}…` : result.releaseNotes; + // Strip markdown formatting for plain-text confirm dialog + let notes = result.releaseNotes + .replace(/^#{1,6}\s+/gm, "") // ## headings + .replace(/\*\*([^*]+)\*\*/g, "$1") // **bold** + .replace(/\*([^*]+)\*/g, "$1") // *italic* + .replace(/`([^`]+)`/g, "$1") // `code` + .replace(/^\s*[-*]\s+/gm, "- ") // normalize list bullets + .replace(/\n{3,}/g, "\n\n") // collapse excess blank lines + .trim(); + if (notes.length > 500) notes = `${notes.slice(0, 500)}…`; changelogBlock = `\n\n--- Changelog ---\n${notes}`; } const approved = await askConfirmPrompt({