Commit 2f5b0265 authored by kaniini's avatar kaniini
Browse files

twitter api: add support for user-specified html policy

parent 735cdfb8
......@@ -168,7 +168,7 @@ def to_map(
{summary, content} = ActivityView.render_content(object)
html =
HTML.filter_tags(content)
HTML.filter_tags(content, User.html_filter_policy(opts[:for]))
|> Formatter.emojify(object["emoji"])
video =
......
......@@ -233,7 +233,7 @@ def render(
{summary, content} = render_content(object)
html =
HTML.filter_tags(content)
HTML.filter_tags(content, User.html_filter_policy(opts[:for]))
|> Formatter.emojify(object["emoji"])
%{
......
......@@ -40,7 +40,7 @@ def render("user.json", %{user: user = %User{}} = assigns) do
data = %{
"created_at" => user.inserted_at |> Utils.format_naive_asctime(),
"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,
"followers_count" => user_info[:follower_count],
"following" => following,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment