fix the status notification with special char

This commit is contained in:
Sachin Joshi 2019-04-24 07:06:17 +05:45
parent 7fcbda702e
commit 963d5774af
2 changed files with 11 additions and 1 deletions

View file

@ -289,7 +289,7 @@ def render(
"uri" => object.data["id"],
"user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
"statusnet_html" => html,
"text" => text,
"text" => HtmlEntities.decode(text),
"is_local" => activity.local,
"is_post_verb" => true,
"created_at" => created_at,

View file

@ -371,4 +371,14 @@ test "a peertube video" do
assert length(result["attachments"]) == 1
assert result["summary"] == "Friday Night"
end
test "special characters are not escaped in text field for status created" do
text = "<3 is on the way"
{:ok, activity} = CommonAPI.post(insert(:user), %{"status" => text})
result = ActivityView.render("activity.json", activity: activity)
assert result["text"] == text
end
end