logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: cdac5efd10bba6e767c59f17e71f2eb8f3f2d601
parent: 79c2cef2fbcbac99cce001376b8231e0e0a9adf4
Author: rinpatch <rinpatch@sdf.org>
Date:   Wed, 22 May 2019 05:39:01 +0000

Merge branch 'bugfix/account_view_source.note' into 'develop'

MastoAPI AccountView: fill source.note with plaintext version of note

Closes #926

See merge request pleroma/pleroma!1189

Diffstat:

Mlib/pleroma/web/mastodon_api/views/account_view.ex2+-
Mtest/web/mastodon_api/account_view_test.exs6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -112,7 +112,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do fields: fields, bot: bot, source: %{ - note: "", + note: HTML.strip_tags((user.bio || "") |> String.replace("<br>", "\n")), sensitive: false, pleroma: %{} }, diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs @@ -55,7 +55,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do fields: [], bot: false, source: %{ - note: "", + note: "valid html", sensitive: false, pleroma: %{} }, @@ -120,7 +120,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do fields: [], bot: true, source: %{ - note: "", + note: user.bio, sensitive: false, pleroma: %{} }, @@ -209,7 +209,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do fields: [], bot: true, source: %{ - note: "", + note: user.bio, sensitive: false, pleroma: %{} },