mirror of
https://github.com/mastodon/mastodon
synced 2024-11-25 07:36:31 +09:00
Refine unescapeHTML (#2977)
This commit is contained in:
parent
e6fbf0334f
commit
7ff84cb07e
@ -1,7 +1,6 @@
|
||||
import api, { getLinks } from '../api'
|
||||
import Immutable from 'immutable';
|
||||
import IntlMessageFormat from 'intl-messageformat';
|
||||
import { unescape } from 'lodash';
|
||||
import { fetchRelationships } from './accounts';
|
||||
|
||||
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
|
||||
@ -25,7 +24,11 @@ const fetchRelatedRelationships = (dispatch, notifications) => {
|
||||
}
|
||||
};
|
||||
|
||||
const unescapeHTML = (html) => unescape(html).replace(/<\/?\w+(?:\s[^>]*)?>/g, '');
|
||||
const unescapeHTML = (html) => {
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.innerHTML = html;
|
||||
return wrapper.textContent;
|
||||
}
|
||||
|
||||
export function updateNotifications(notification, intlMessages, intlLocale) {
|
||||
return (dispatch, getState) => {
|
||||
|
Loading…
Reference in New Issue
Block a user