From 3dcb5fa28f13f597d49b5b442f61d12bc2be6152 Mon Sep 17 00:00:00 2001 From: beatrix Date: Fri, 12 May 2017 22:03:43 -0400 Subject: Revert HTML CW changes (#3020) * selectively Revert "Fix regressions from #2683 (#2970)" This reverts commit 72698bc3b49925a2b2955f32e5a562c1eecd729b. * Revert "Handle hashtags in spoiler_texts (partial fix for #699) (#2683)" This reverts commit e2491680e696d2c285a798ec4c66b26d2748df66. --- app/javascript/mastodon/actions/notifications.js | 2 +- app/javascript/mastodon/components/status_content.js | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index 323e2e9b6..da3d562d5 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -53,7 +53,7 @@ export function updateNotifications(notification, intlMessages, intlLocale) { // Desktop notifications if (typeof window.Notification !== 'undefined' && showAlert) { const title = new IntlMessageFormat(intlMessages[`notification.${notification.type}`], intlLocale).format({ name: notification.account.display_name.length > 0 ? notification.account.display_name : notification.account.username }); - const body = (notification.status && notification.status.spoiler_text.length > 0) ? unescapeHTML(notification.status.spoiler_text) : unescapeHTML(notification.status ? notification.status.content : ''); + const body = (notification.status && notification.status.spoiler_text.length > 0) ? notification.status.spoiler_text : unescapeHTML(notification.status ? notification.status.content : ''); const notify = new Notification(title, { body, icon: notification.account.avatar, tag: notification.id }); notify.addEventListener('click', () => { diff --git a/app/javascript/mastodon/components/status_content.js b/app/javascript/mastodon/components/status_content.js index f7d6b750f..c51f85d10 100644 --- a/app/javascript/mastodon/components/status_content.js +++ b/app/javascript/mastodon/components/status_content.js @@ -93,7 +93,7 @@ class StatusContent extends React.PureComponent { const { hidden } = this.state; const content = { __html: emojify(status.get('content')) }; - const spoilerContent = { __html: emojify(status.get('spoiler_text', '')) }; + const spoilerContent = { __html: emojify(escapeTextContentForBrowser(status.get('spoiler_text', ''))) }; const directionStyle = { direction: 'ltr' }; if (isRtl(status.get('content'))) { @@ -116,19 +116,16 @@ class StatusContent extends React.PureComponent { } return ( -
+
{mentionsPlaceholder} ); } else if (this.props.onClick) { -- cgit