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

Closes: https://git.pleroma.social/pleroma/pleroma/issues/926
This commit is contained in:
Haelwenn (lanodan) Monnier 2019-05-22 07:22:19 +02:00
parent b30b51c3b7
commit 0e2c215a00
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
2 changed files with 4 additions and 4 deletions

View File

@ -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: %{}
},

View File

@ -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: %{}
},