aboutsummaryrefslogtreecommitdiff
path: root/test/web/common_api
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-04-08 22:58:31 +0300
committerrinpatch <rinpatch@sdf.org>2020-04-08 22:58:31 +0300
commitd067eaa7b3bb76e7fc5ae019d6e00510b657171d (patch)
tree1e70580489a5561f6a04fee5e0d2662d7653d119 /test/web/common_api
parentdd4d10b275e76afc029aea642ae3d69b07e33d81 (diff)
downloadpleroma-d067eaa7b3bb76e7fc5ae019d6e00510b657171d.tar.gz
formatter.ex: Use Phoenix.HTML for mention/hashtag generation
Unlike concatenating strings, this makes sure everything is escaped. Tests had to be changed because Phoenix.HTML runs attributes through Enum.sort before generation for whatever reason.
Diffstat (limited to 'test/web/common_api')
-rw-r--r--test/web/common_api/common_api_utils_test.exs6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs
index d383d1714..98cf02d49 100644
--- a/test/web/common_api/common_api_utils_test.exs
+++ b/test/web/common_api/common_api_utils_test.exs
@@ -159,11 +159,11 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
{output, _, _} = Utils.format_input(text, "text/markdown")
assert output ==
- ~s(<p><strong>hello world</strong></p><p><em>another <span class="h-card"><a data-user="#{
+ ~s(<p><strong>hello world</strong></p><p><em>another <span class="h-card"><a class="u-url mention" data-user="#{
user.id
- }" class="u-url mention" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> and <span class="h-card"><a data-user="#{
+ }" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> and <span class="h-card"><a class="u-url mention" data-user="#{
user.id
- }" class="u-url mention" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> <a href="http://google.com" rel="ugc">google.com</a> paragraph</em></p>)
+ }" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> <a href="http://google.com" rel="ugc">google.com</a> paragraph</em></p>)
end
end