aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-01 15:14:22 +0200
committerlain <lain@soykaf.club>2020-06-01 15:14:22 +0200
commitaf9090238e1f71e6b081fbd09c09a5975d2ed99e (patch)
tree8930568a6cea53e180e2e8d9a79808d1815a22a6 /lib
parent8ff342582839259f3b8e039c6b3da3c0cf798a1f (diff)
downloadpleroma-af9090238e1f71e6b081fbd09c09a5975d2ed99e.tar.gz
CommonAPI: Newlines -> br for chat messages.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/common_api/common_api.ex3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
index 173353aa5..e0987b1a7 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -54,6 +54,9 @@ defmodule Pleroma.Web.CommonAPI do
content
|> Formatter.html_escape("text/plain")
|> Formatter.linkify()
+ |> (fn {text, mentions, tags} ->
+ {String.replace(text, ~r/\r?\n/, "<br>"), mentions, tags}
+ end).()
text
end