Merge branch 'feature/peertube_2' into 'develop'
[akkoma] / lib / pleroma / web / twitter_api / views / user_view.ex
index 30cf266bdd17f2ae8cb7abec5459748e0cce6d11..25fda1aa80af3cf017f9c9977d10d392af122124 100644 (file)
@@ -36,12 +36,10 @@ 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,6 +48,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
       "friends_count" => user_info[:following_count],
       "id" => user.id,
       "name" => user.name,
+      "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,
@@ -58,7 +57,6 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
         "delete_others_notice" => !!user.info["is_moderator"]
       },
       "screen_name" => user.nickname,
-      "screen_name_html" => Formatter.emojify(user.nickname, emoji),
       "statuses_count" => user_info[:note_count],
       "statusnet_profile_url" => user.ap_id,
       "cover_photo" => User.banner_url(user) |> MediaProxy.url(),