aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/utils.ex
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2018-08-21 16:55:26 +0000
committerkaniini <nenolod@gmail.com>2018-08-21 16:55:26 +0000
commit5a8bb3cb3b0cc7de82bd699d68519593349fee53 (patch)
treed5987639430bf584a8744b677f623e1efad4e36a /lib/pleroma/web/common_api/utils.ex
parentc1b8a6a73bfd5f30d5a290b9700ed4d41064ce77 (diff)
parente883587cc3a0c386e3cc3f63c2d8a2d64f7c953b (diff)
downloadpleroma-5a8bb3cb3b0cc7de82bd699d68519593349fee53.tar.gz
Merge branch 'twitter-api-bios' into 'develop'
Twitter API: Support Mastodon-style bios See merge request pleroma/pleroma!283
Diffstat (limited to 'lib/pleroma/web/common_api/utils.ex')
-rw-r--r--lib/pleroma/web/common_api/utils.ex3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index c7b0d7935..869f4c566 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -64,7 +64,6 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def make_content_html(status, mentions, attachments, tags, no_attachment_links \\ false) do
status
- |> String.replace("\r", "")
|> format_input(mentions, tags)
|> maybe_add_attachments(attachments, no_attachment_links)
end
@@ -95,7 +94,7 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def format_input(text, mentions, tags) do
text
|> Formatter.html_escape()
- |> String.replace("\n", "<br>")
+ |> String.replace(~r/\r?\n/, "<br>")
|> (&{[], &1}).()
|> Formatter.add_links()
|> Formatter.add_user_links(mentions)