From f690320fb93ea1a884a292f9e099eb1bc0834b6d Mon Sep 17 00:00:00 2001
From: Rachel H <rainyday@users.noreply.github.com>
Date: Mon, 10 Apr 2017 12:32:45 -0700
Subject: [PATCH] Keep newlines in xml (#1397)

---
 app/assets/javascripts/components/components/status_content.jsx | 2 +-
 app/lib/formatter.rb                                            | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx
index 52826ace0f..e0cca6113c 100644
--- a/app/assets/javascripts/components/components/status_content.jsx
+++ b/app/assets/javascripts/components/components/status_content.jsx
@@ -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' };
 
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index da7ad20275..c3f331ff7d 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -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)
-- 
GitLab