X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fcommon_api%2Fcommon_api.ex;h=e0987b1a7d36a2340f839980ad6d12aa43d59648;hb=af9090238e1f71e6b081fbd09c09a5975d2ed99e;hp=764fa4f4fbfd4c0d21260c4a8c4a8752ed2384cd;hpb=af6d01ec93a07cd896bc4f0a2c2cf437c6fd51fc;p=akkoma diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 764fa4f4f..e0987b1a7 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -50,7 +50,15 @@ defmodule Pleroma.Web.CommonAPI do defp format_chat_content(nil), do: nil defp format_chat_content(content) do - content |> Formatter.html_escape("text/plain") + {text, _, _} = + content + |> Formatter.html_escape("text/plain") + |> Formatter.linkify() + |> (fn {text, mentions, tags} -> + {String.replace(text, ~r/\r?\n/, "
"), mentions, tags} + end).() + + text end defp validate_chat_content_length(_, true), do: :ok