diff --git a/public/notifications.xml b/public/notifications.xml index bd706913..e9ba6cda 100644 --- a/public/notifications.xml +++ b/public/notifications.xml @@ -8,11 +8,30 @@ Mon, 28 Jul 2025 21:53:00 GMT + + notification-032 + Bug fixes and source updates! + +- Fixed speed boost not working on mobile! You should now be able to hold the screen to 2x the video! + +I also briefly broke the site for a few minutes, sorry about that! + +Source updates: +- Added Flicky (thanks lew!) +- Fixed VidSrcCx +- Disabled SpeedStrm + +If you are interested in adding a new source to P-Stream, I recently created a new guide for it! Check the link below. +https://providers.pstream.mov/in-depth/development + Tue, 05 Aug 2025 10:55:00 MST + bugfix + + + notification-30 Digital Privacy Survey - - I am conducting a survey to understand how people use privacy features in their daily lives and how it affects them mentally. + I am conducting a survey to understand how people use privacy features in their daily lives and how it affects them mentally. If you have a few minutes, please take the survey linked below! diff --git a/src/components/overlays/notificationsModal/components/DetailView.tsx b/src/components/overlays/notificationsModal/components/DetailView.tsx index 4b53e19a..dd70f823 100644 --- a/src/components/overlays/notificationsModal/components/DetailView.tsx +++ b/src/components/overlays/notificationsModal/components/DetailView.tsx @@ -2,6 +2,7 @@ import { Icon, Icons } from "@/components/Icon"; import { Link } from "@/pages/migration/utils"; import { DetailViewProps } from "../types"; +import { formatNotificationDescription } from "../utils"; export function DetailView({ selectedNotification, @@ -91,18 +92,9 @@ export function DetailView({ className="text-type-secondary leading-relaxed" // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ - __html: selectedNotification.description - .replace(/\n\n/g, "

") - .replace(/\n- /g, "

• ") - .replace(/\n\*\*([^*]+)\*\*/g, "

$1

") - .replace(/^/, "

") - .replace(/$/, "

") - .replace(/

<\/p>/g, "") - .replace( - /

• /g, - '

', - ) - .replace(/<\/p>/g, "

"), + __html: formatNotificationDescription( + selectedNotification.description, + ), }} /> diff --git a/src/components/overlays/notificationsModal/components/ListView.tsx b/src/components/overlays/notificationsModal/components/ListView.tsx index 21f30c77..306fafd1 100644 --- a/src/components/overlays/notificationsModal/components/ListView.tsx +++ b/src/components/overlays/notificationsModal/components/ListView.tsx @@ -1,6 +1,7 @@ import { Icon, Icons } from "@/components/Icon"; import { ListViewProps } from "../types"; +import { formatNotificationDescription } from "../utils"; export function ListView({ notifications, @@ -185,22 +186,9 @@ export function ListView({ // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: - notification.description - .replace(/\n\n/g, "

") - .replace(/\n- /g, "

• ") - .replace( - /\n\*\*([^*]+)\*\*/g, - "

$1

", - ) - .replace(/^/, "

") - .replace(/$/, "

") - .replace(/

<\/p>/g, "") - .replace( - /

• /g, - '

', - ) - .replace(/<\/p>/g, "

") - .substring(0, 150) + + formatNotificationDescription( + notification.description, + ).substring(0, 150) + (notification.description.length > 150 ? "..." : ""), diff --git a/src/components/overlays/notificationsModal/utils/index.ts b/src/components/overlays/notificationsModal/utils/index.ts index 86080f03..36e4ab0f 100644 --- a/src/components/overlays/notificationsModal/utils/index.ts +++ b/src/components/overlays/notificationsModal/utils/index.ts @@ -136,3 +136,32 @@ export const getCategoryLabel = (category: string) => { return category; } }; +export function formatNotificationDescription(description: string): string { + return ( + description + // First, normalize multiple consecutive line breaks to single line breaks + .replace(/\n{3,}/g, "\n\n") + // Handle bullet points before paragraph breaks + .replace(/\n- /g, "

• ") + // Handle bold text (headers) + .replace(/\n\*\*([^*]+)\*\*/g, "

$1

") + // Handle paragraph breaks (double line breaks) + .replace(/\n\n/g, "


") + // Handle single line breaks within paragraphs + .replace(/\n/g, "
") + // Wrap in paragraph tags + .replace(/^/, "

") + .replace(/$/, "

") + // Remove empty paragraphs + .replace(/

<\/p>/g, "") + // Clean up consecutive paragraph tags + .replace(/<\/p>

<\/p>/g, "

") + .replace(/

<\/p>

/g, "

") + // Style bullet points + .replace( + /

• /g, + '

', + ) + .replace(/<\/p>/g, "

") + ); +}