1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-01 00:08:21 +09:00

Fix #1609, fix #1628 - Revert #1397 (#1700)

When transmitting data in a HTML-encoded element like <content type="html" />,
relying on newlines being preserved is not wise, since HTML by itself
does not care for newlines - it cares for <p> and <br>

Additional fix: reset NSFW toggle after sending toot
This commit is contained in:
Eugen 2017-04-13 19:23:36 +02:00 committed by GitHub
parent 9e5c1c487e
commit 043862f411
3 changed files with 3 additions and 1 deletions

View File

@ -92,7 +92,7 @@ const StatusContent = React.createClass({
const { status } = this.props; const { status } = this.props;
const { hidden } = this.state; const { hidden } = this.state;
const content = { __html: emojify(status.get('content')).replace(/\n/g, '') }; const content = { __html: emojify(status.get('content')) };
const spoilerContent = { __html: emojify(escapeTextContentForBrowser(status.get('spoiler_text', ''))) }; const spoilerContent = { __html: emojify(escapeTextContentForBrowser(status.get('spoiler_text', ''))) };
const directionStyle = { direction: 'ltr' }; const directionStyle = { direction: 'ltr' };

View File

@ -67,6 +67,7 @@ function clearAll(state) {
map.set('is_submitting', false); map.set('is_submitting', false);
map.set('in_reply_to', null); map.set('in_reply_to', null);
map.set('privacy', state.get('default_privacy')); map.set('privacy', state.get('default_privacy'));
map.set('sensitive', false);
map.update('media_attachments', list => list.clear()); map.update('media_attachments', list => list.clear());
}); });
}; };

View File

@ -15,6 +15,7 @@ class Formatter
html = status.text html = status.text
html = encode(html) html = encode(html)
html = simple_format(html, {}, sanitize: false) html = simple_format(html, {}, sanitize: false)
html = html.gsub(/\n/, '')
html = link_urls(html) html = link_urls(html)
html = link_mentions(html, status.mentions) html = link_mentions(html, status.mentions)
html = link_hashtags(html) html = link_hashtags(html)