aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorensra <ensra@users.noreply.github.com>2018-08-21 14:51:27 +0100
committerensra <ensra@users.noreply.github.com>2018-08-21 14:51:27 +0100
commit1495d04789239f78e06c7b4af4219f54be15eeaa (patch)
tree560bc9121940b0dc5ced20bb1eb2a8eef3e7e7ec /lib
parentcdb3dd48ab7177a21e1cdcef4bcff00bf5dc124f (diff)
downloadpleroma-1495d04789239f78e06c7b4af4219f54be15eeaa.tar.gz
fix test for converting bio \r\n to <br>.
Diffstat (limited to 'lib')
-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)