about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-05-11 09:22:40 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-11 02:22:40 +0200
commit7ff84cb07e799ae997b1f8bcc1e1a1bddd178dfb (patch)
treeb75098be2fd48cfc625fc39d399b66eec1576f7f /app/javascript
parente6fbf0334fa665069c61a0b238cec3350949e88f (diff)
Refine unescapeHTML (#2977)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/actions/notifications.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js
index 61a245822..1be4ae3a1 100644
--- a/app/javascript/mastodon/actions/notifications.js
+++ b/app/javascript/mastodon/actions/notifications.js
@@ -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) => {