about summary refs log tree commit diff
path: root/app/lib/formatter.rb
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-04-13 19:23:36 +0200
committerGitHub <noreply@github.com>2017-04-13 19:23:36 +0200
commit043862f4118a9ee5e6708ff9c144fa9e668ee06d (patch)
tree5e8bb2db27240c95854cd3eefd4b8db56696afa2 /app/lib/formatter.rb
parent9e5c1c487eadd1720dc147898a676ddb0038bde2 (diff)
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
Diffstat (limited to 'app/lib/formatter.rb')
-rw-r--r--app/lib/formatter.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index b6d371ed2..64349e68e 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -15,6 +15,7 @@ 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)