import escapeTextContentForBrowser from 'escape-html';
import emojify from '../../features/emoji/emoji';
+import { unescapeHTML } from '../../utils/html';
const domParser = new DOMParser();
...pair,
name_emojified: emojify(escapeTextContentForBrowser(pair.name)),
value_emojified: emojify(pair.value, emojiMap),
+ value_plain: unescapeHTML(pair.value),
}));
}
importFetchedStatuses,
} from './importer';
import { defineMessages } from 'react-intl';
+import { unescapeHTML } from '../utils/html';
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';
}
};
-const unescapeHTML = (html) => {
- const wrapper = document.createElement('div');
- html = html.replace(/<br \/>|<br>|\n/g, ' ');
- wrapper.innerHTML = html;
- return wrapper.textContent;
-};
-
export function updateNotifications(notification, intlMessages, intlLocale) {
return (dispatch, getState) => {
const showInColumn = getState().getIn(['settings', 'notifications', 'shows', notification.type], true);
{fields.map((pair, i) => (
<dl key={i}>
<dt dangerouslySetInnerHTML={{ __html: pair.get('name_emojified') }} title={pair.get('name')} />
- <dd dangerouslySetInnerHTML={{ __html: pair.get('value_emojified') }} title={pair.get('value')} />
+ <dd dangerouslySetInnerHTML={{ __html: pair.get('value_emojified') }} title={pair.get('value_plain')} />
</dl>
))}
</div>
--- /dev/null
+export const unescapeHTML = (html) => {
+ const wrapper = document.createElement('div');
+ html = html.replace(/<br \/>|<br>|\n/g, ' ');
+ wrapper.innerHTML = html;
+ return wrapper.textContent;
+};