From 2bcfbbc3711728663d9d5c81093b8e4b76565838 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Wed, 13 Aug 2025 15:32:50 +0800 Subject: [PATCH] Optimize comment notification template to support rich text rendering (#7683) #### What type of PR is this? /area core /area ui /milestone 2.21.x /kind feature #### What this PR does / why we need it: Optimize comment notification template to support rich text rendering #### Does this PR introduce a user-facing change? ```release-note None ``` --- .../extensions/notification-templates.yaml | 15 +++--- .../presets/users/NotificationWidget.vue | 8 +++- .../modules/notifications/Notifications.vue | 4 +- .../components/NotificationContent.vue | 47 +++++++++---------- .../components/NotificationListItem.vue | 17 +++++-- 5 files changed, 53 insertions(+), 38 deletions(-) diff --git a/application/src/main/resources/extensions/notification-templates.yaml b/application/src/main/resources/extensions/notification-templates.yaml index 6290a2246..719e5963f 100644 --- a/application/src/main/resources/extensions/notification-templates.yaml +++ b/application/src/main/resources/extensions/notification-templates.yaml @@ -25,7 +25,7 @@ spec: ,以下是评论的具体内容:
- + @@ -58,7 +58,7 @@ spec: ,以下是评论的具体内容: - + @@ -87,15 +87,18 @@ spec: diff --git a/ui/console-src/modules/dashboard/widgets/presets/users/NotificationWidget.vue b/ui/console-src/modules/dashboard/widgets/presets/users/NotificationWidget.vue index e94a67320..63669d44c 100644 --- a/ui/console-src/modules/dashboard/widgets/presets/users/NotificationWidget.vue +++ b/ui/console-src/modules/dashboard/widgets/presets/users/NotificationWidget.vue @@ -14,6 +14,7 @@ import { } from "@halo-dev/components"; import { useQuery } from "@tanstack/vue-query"; import { OverlayScrollbarsComponent } from "overlayscrollbars-vue"; +import sanitize from "sanitize-html"; const { currentUser } = useUserStore(); @@ -81,7 +82,12 @@ function handleRouteToNotification(notification: Notification) {