CommonAPI: Newlines -> br for chat messages.
[akkoma] / lib / pleroma / web / common_api / common_api.ex
index 173353aa5ac363a646a5d56005cb485d4875cd36..e0987b1a7d36a2340f839980ad6d12aa43d59648 100644 (file)
@@ -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