Fix auto-summary: strip markdown formatting from AI responses

This commit is contained in:
Ronald Klarenbeek 2026-02-27 15:28:56 +01:00
parent ca07cf5ed0
commit 7dfdc2ea54

View file

@ -501,7 +501,10 @@ async function _generateSummaryForMessage(headerMessageId, tabId) {
await cmd.initWorker();
const aiResponse = await cmd.sendPrompt();
const cleanedSummary = aiResponse.replace(/\s+/g, ' ').trim();
let cleanedSummary = aiResponse.replace(/```[\s\S]*?```/g, '');
cleanedSummary = cleanedSummary.replace(/[\*#_~`]/g, '');
cleanedSummary = cleanedSummary.replace(/\s+/g, ' ').trim();
cleanedSummary = cleanedSummary.replace(/^Summary:\s*/i, '');
const summaryData = {
summary: cleanedSummary,