Fix auto-summary: strip markdown formatting from AI responses
This commit is contained in:
parent
ca07cf5ed0
commit
7dfdc2ea54
1 changed files with 4 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue