Fix: Prevent raw HTML rendering in notifications (#1299)

This commit is contained in:
end-4
2025-05-19 21:56:19 +02:00
committed by GitHub
@@ -39,12 +39,12 @@ function guessMessageType(summary) {
} }
function processNotificationBody(body, appEntry) { function processNotificationBody(body, appEntry) {
// Only process Chrome/Chromium notifications let processedBody = body;
if (appEntry?.toLowerCase().includes('chrome')) { if (appEntry?.toLowerCase().includes('chrome')) {
// Remove the first line processedBody = body.split('\n\n').slice(1).join('\n\n');
return body.split('\n\n').slice(1).join('\n\n');
} }
return body; processedBody = processedBody.replace(/<[^>]*>/g, '');
return processedBody;
} }
const getFriendlyNotifTimeString = (timeObject) => { const getFriendlyNotifTimeString = (timeObject) => {