mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-25 16:38:15 +00:00
twitter api: add support for user-specified html policy
This commit is contained in:
parent
735cdfb848
commit
2f5b026548
3 changed files with 3 additions and 3 deletions
|
@ -168,7 +168,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
|
||||||
{summary, content} = ActivityView.render_content(object)
|
{summary, content} = ActivityView.render_content(object)
|
||||||
|
|
||||||
html =
|
html =
|
||||||
HTML.filter_tags(content)
|
HTML.filter_tags(content, User.html_filter_policy(opts[:for]))
|
||||||
|> Formatter.emojify(object["emoji"])
|
|> Formatter.emojify(object["emoji"])
|
||||||
|
|
||||||
video =
|
video =
|
||||||
|
|
|
@ -233,7 +233,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
|
||||||
{summary, content} = render_content(object)
|
{summary, content} = render_content(object)
|
||||||
|
|
||||||
html =
|
html =
|
||||||
HTML.filter_tags(content)
|
HTML.filter_tags(content, User.html_filter_policy(opts[:for]))
|
||||||
|> Formatter.emojify(object["emoji"])
|
|> Formatter.emojify(object["emoji"])
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
|
@ -40,7 +40,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
|
||||||
data = %{
|
data = %{
|
||||||
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
|
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
|
||||||
"description" => HTML.strip_tags((user.bio || "") |> String.replace("<br>", "\n")),
|
"description" => HTML.strip_tags((user.bio || "") |> String.replace("<br>", "\n")),
|
||||||
"description_html" => HTML.filter_tags(user.bio),
|
"description_html" => HTML.filter_tags(user.bio, User.html_filter_policy(assigns[:for])),
|
||||||
"favourites_count" => 0,
|
"favourites_count" => 0,
|
||||||
"followers_count" => user_info[:follower_count],
|
"followers_count" => user_info[:follower_count],
|
||||||
"following" => following,
|
"following" => following,
|
||||||
|
|
Loading…
Reference in a new issue