Run mix format
[akkoma] / lib / pleroma / web / twitter_api / views / user_view.ex
index 30aaaf1ceb87f90630363c00bfd78b18d9162bf2..32f93153dc6b61699d5d0174b165a71b92d5205f 100644 (file)
@@ -36,12 +36,11 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
         {String.trim(name, ":"), url}
       end)
 
-    bio = HtmlSanitizeEx.strip_tags(user.bio)
-
     data = %{
       "created_at" => user.inserted_at |> Utils.format_naive_asctime(),
-      "description" => bio,
-      "description_html" => bio |> Formatter.emojify(emoji),
+      "description" =>
+        HtmlSanitizeEx.strip_tags((user.bio || "") |> String.replace("<br>", "\n")),
+      "description_html" => HtmlSanitizeEx.basic_html(user.bio),
       "favourites_count" => 0,
       "followers_count" => user_info[:follower_count],
       "following" => following,
@@ -50,7 +49,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
       "friends_count" => user_info[:following_count],
       "id" => user.id,
       "name" => user.name,
-      "name_html" => Formatter.emojify(user.name, emoji),
+      "name_html" => HtmlSanitizeEx.strip_tags(user.name) |> Formatter.emojify(emoji),
       "profile_image_url" => image,
       "profile_image_url_https" => image,
       "profile_image_url_profile_size" => image,