Skip to content
Snippets Groups Projects
Unverified Commit e583f110 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Unescape HTML entities in rich web push notifications in web UI (#7569)

parent 41b2cfe5
No related branches found
No related tags found
No related merge requests found
import IntlMessageFormat from 'intl-messageformat';
import locales from './web_push_locales';
import { unescape } from 'lodash';
const MAX_NOTIFICATIONS = 5;
const GROUP_TAG = 'tag';
......@@ -60,7 +61,7 @@ const formatMessage = (messageId, locale, values = {}) =>
(new IntlMessageFormat(locales[locale][messageId], locale)).format(values);
const htmlToPlainText = html =>
html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n').replace(/<[^>]*>/g, '');
unescape(html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n').replace(/<[^>]*>/g, ''));
const handlePush = (event) => {
const { access_token, notification_id, preferred_locale, title, body, icon } = event.data.json();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment