diff --git a/.config/quickshell/modules/common/widgets/NotificationItem.qml b/.config/quickshell/modules/common/widgets/NotificationItem.qml index 26286290c..33e901f62 100644 --- a/.config/quickshell/modules/common/widgets/NotificationItem.qml +++ b/.config/quickshell/modules/common/widgets/NotificationItem.qml @@ -35,6 +35,22 @@ Item { // Notification item area implicitHeight: background.implicitHeight + function processNotificationBody(body, appName) { + let processedBody = body + + // Handle Brave/Chrome notifications - remove first line + if (appName && appName.toLowerCase().includes('brave')) { + const lines = body.split('\n\n') + if (lines.length > 1) { + processedBody = lines.slice(1).join('\n\n') + } + } + + // Remove HTML tags + processedBody = processedBody.replace(/<[^>]*>/g, '') + return processedBody + } + function destroyWithAnimation() { root.qmlParent.resetDrag() background.anchors.leftMargin = background.anchors.leftMargin; // Break binding @@ -173,7 +189,10 @@ Item { // Notification item area color: Appearance.colors.colSubtext elide: Text.ElideRight textFormat: Text.StyledText - text: notificationObject.body.replace(/img{max-width:${notificationBodyText.width}px;}` + - `${notificationObject.body.replace(/\n/g, "
")}` + text: { + const processedBody = processNotificationBody(notificationObject.body, notificationObject.appName || notificationObject.summary) + return `` + + `${processedBody.replace(/\n/g, "
")}` + } onLinkActivated: (link) => { Qt.openUrlExternally(link) @@ -298,4 +320,4 @@ Item { // Notification item area } } } -} \ No newline at end of file +}