Changed to support \r\n and \n
authorWim Vanderbauwhede <Wim.Vanderbauwhede@mail.be>
Tue, 24 Apr 2018 12:28:55 +0000 (13:28 +0100)
committerWim Vanderbauwhede <Wim.Vanderbauwhede@mail.be>
Tue, 24 Apr 2018 12:28:55 +0000 (13:28 +0100)
lib/pleroma/web/twitter_api/twitter_api_controller.ex

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