reply_user = reply_parent && User.get_cached_by_ap_id(reply_parent.actor)
+ summary = HTML.strip_tags(object["summary"])
+
%{
"id" => activity.id,
"uri" => activity.data["object"]["id"],
"activity_type" => "post",
"possibly_sensitive" => possibly_sensitive,
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
- "summary" => HTML.strip_tags(object["summary"]) |> Formatter.emojify(object["emoji"])
+ "summary" => summary,
+ "summary_html" => summary |> Formatter.emojify(object["emoji"])
}
end
reply_user = reply_parent && User.get_cached_by_ap_id(reply_parent.actor)
+ summary = HTML.strip_tags(summary)
+
%{
"id" => activity.id,
"uri" => activity.data["object"]["id"],
"activity_type" => "post",
"possibly_sensitive" => possibly_sensitive,
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
- "summary" => HTML.strip_tags(summary) |> Formatter.emojify(object["emoji"])
+ "summary" => summary,
+ "summary_html" => summary |> Formatter.emojify(object["emoji"])
}
end
"possibly_sensitive" => true,
"uri" => activity.data["object"]["id"],
"visibility" => "direct",
- "summary" => "2hu"
+ "summary" => "2hu",
+ "summary_html" => "2hu"
}
assert ActivityRepresenter.to_map(activity, %{
result = ActivityView.render("activity.json", activity: activity)
- expected =
+ expected = ":woollysocks: meow"
+
+ expected_html =
"<img height=\"32px\" width=\"32px\" alt=\"woollysocks\" title=\"woollysocks\" src=\"http://localhost:4001/finmoji/128px/woollysocks-128.png\" /> meow"
assert result["summary"] == expected
+ assert result["summary_html"] == expected_html
end
test "a create activity with a summary containing invalid HTML" do
expected = "meow"
assert result["summary"] == expected
+ assert result["summary_html"] == expected
end
test "a create activity with a note" do
"repeated" => false,
"statusnet_conversation_id" => convo_id,
"summary" => "",
+ "summary_html" => "",
"statusnet_html" =>
"Hey <span><a data-user=\"#{other_user.id}\" href=\"#{other_user.ap_id}\">@<span>shp</span></a></span>!",
"tags" => [],