mirror of
https://github.com/p-stream/p-stream.git
synced 2026-03-11 09:45:33 +00:00
dompurify notifications
This commit is contained in:
parent
e083ca8764
commit
cb5b46d7c9
1 changed files with 3 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import DOMPurify from "dompurify";
|
||||
|
||||
import { proxiedFetch } from "@/backend/helpers/fetch";
|
||||
|
||||
const DEFAULT_FEEDS = ["/notifications.xml"];
|
||||
|
|
@ -138,7 +140,7 @@ export const getCategoryLabel = (category: string) => {
|
|||
};
|
||||
export function formatNotificationDescription(description: string): string {
|
||||
return (
|
||||
description
|
||||
DOMPurify.sanitize(description)
|
||||
// First, normalize multiple consecutive line breaks to single line breaks
|
||||
.replace(/\n{3,}/g, "\n\n")
|
||||
// Handle bullet points before paragraph breaks
|
||||
|
|
|
|||
Loading…
Reference in a new issue