Fix: Prevent raw HTML rendering in notifications

Notifications were occasionally displaying raw HTML content,
including tags, instead of the intended plain text message.

This commit introduces a regex to strip all HTML tags from
notification content before display, ensuring a proper
user experience.
This commit is contained in:
Samuel Leutner
2025-05-16 17:57:24 -03:00
parent feca4c6256
commit 09696d9fdb
@@ -39,12 +39,12 @@ function guessMessageType(summary) {
}
function processNotificationBody(body, appEntry) {
// Only process Chrome/Chromium notifications
let processedBody = body;
if (appEntry?.toLowerCase().includes('chrome')) {
// Remove the first line
return body.split('\n\n').slice(1).join('\n\n');
processedBody = body.split('\n\n').slice(1).join('\n\n');
}
return body;
processedBody = processedBody.replace(/<[^>]*>/g, '');
return processedBody;
}
const getFriendlyNotifTimeString = (timeObject) => {