From 309981a2949f5e7ac1c75e3d6e9b4f4b9cb5d8b9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 28 Jan 2022 11:52:41 -0600 Subject: [PATCH] sw.js: Fix display of RT line in push notifications --- app/soapbox/service_worker/web_push_notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/service_worker/web_push_notifications.js b/app/soapbox/service_worker/web_push_notifications.js index a43fec6d8..b73dabf42 100644 --- a/app/soapbox/service_worker/web_push_notifications.js +++ b/app/soapbox/service_worker/web_push_notifications.js @@ -73,7 +73,7 @@ const formatMessage = (messageId, locale, values = {}) => (new IntlMessageFormat(locales[locale][messageId], locale)).format(values); const htmlToPlainText = html => - unescape(html.replace(//g, '\n').replace(/<\/p>

/g, '\n\n').replace(/<[^>]*>/g, '')); + unescape(html.replace(//g, '\n').replace(/<\/p><[^>]*>/g, '\n\n').replace(/<[^>]*>/g, '')); const handlePush = (event) => { const { access_token, notification_id, preferred_locale, title, body, icon } = event.data.json();