]> cat aescling's git repositories - mastodon.git/commitdiff
Keep newlines in xml (#1397)
authorRachel H <rainyday@users.noreply.github.com>
Mon, 10 Apr 2017 19:32:45 +0000 (12:32 -0700)
committerEugen <eugen@zeonfederated.com>
Mon, 10 Apr 2017 19:32:45 +0000 (21:32 +0200)
app/assets/javascripts/components/components/status_content.jsx
app/lib/formatter.rb

index 52826ace0f6280dd132f8bb8d77e6cf736a01d14..e0cca6113c5b80bbfb6fa0d391e80f0248bd19ab 100644 (file)
@@ -91,7 +91,7 @@ const StatusContent = React.createClass({
     const { status } = this.props;
     const { hidden } = this.state;
 
-    const content = { __html: emojify(status.get('content')) };
+    const content = { __html: emojify(status.get('content')).replace(/\n/g, '') };
     const spoilerContent = { __html: emojify(escapeTextContentForBrowser(status.get('spoiler_text', ''))) };
     const directionStyle = { direction: 'ltr' };
 
index da7ad2027513443927737ca58ea3342749b04f64..c3f331ff7d0ce1cf625e37cfa4333ad8d77fa397 100644 (file)
@@ -15,7 +15,6 @@ class Formatter
     html = status.text
     html = encode(html)
     html = simple_format(html, {}, sanitize: false)
-    html = html.gsub(/\n/, '')
     html = link_urls(html)
     html = link_mentions(html, status.mentions)
     html = link_hashtags(html)