forked from Shinonome/dots-hyprland
Fix: Prevent raw HTML rendering in notifications (#1299)
This commit is contained in:
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user