Patch to replace newlines with <br> tags in bio
authorWim Vanderbauwhede <Wim.Vanderbauwhede@mail.be>
Tue, 24 Apr 2018 12:20:17 +0000 (13:20 +0100)
committerWim Vanderbauwhede <Wim.Vanderbauwhede@mail.be>
Tue, 24 Apr 2018 12:20:17 +0000 (13:20 +0100)
lib/pleroma/web/twitter_api/twitter_api_controller.ex

index 6cf8682b882033147c34d844e4c3d69c3f23b2a4..0ee90496f7259b66a3a6a92f882c567060948fc6 100644 (file)
@@ -347,7 +347,8 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
   def update_profile(%{assigns: %{user: user}} = conn, params) do
     params =
       if bio = params["description"] do
-        Map.put(params, "bio", bio)
+        bio_brs = Regex.replace(~r/\r\n/,bio,"<br>")
+        Map.put(params, "bio", bio_brs)
       else
         params
       end