sw.js: Fix display of RT line in push notifications

This commit is contained in:
Alex Gleason 2022-01-28 11:52:41 -06:00
parent 91fe4f4306
commit 309981a294
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -73,7 +73,7 @@ const formatMessage = (messageId, locale, values = {}) =>
(new IntlMessageFormat(locales[locale][messageId], locale)).format(values);
const htmlToPlainText = html =>
unescape(html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n').replace(/<[^>]*>/g, ''));
unescape(html.replace(/<br\s*\/?>/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();