aboutsummaryrefslogtreecommitdiff
path: root/test/html_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-06-19 08:48:41 +0000
committerlain <lain@soykaf.club>2019-06-19 08:48:41 +0000
commit5c6c4ce634d6fe17f62b71871ecb28edc34a40dd (patch)
tree95c4048fb52dc8aff13999b740b709816946846b /test/html_test.exs
parent90e47d43578803cf74f760db7777cbaba50bb8d9 (diff)
parent035368d363e31bd99efb21e1c121574718c81b5e (diff)
downloadpleroma-5c6c4ce634d6fe17f62b71871ecb28edc34a40dd.tar.gz
Merge branch 'fix/rich-media-hashtags-again' into 'develop'
Rich Media: Skip Microformats hashtags See merge request pleroma/pleroma!1304
Diffstat (limited to 'test/html_test.exs')
-rw-r--r--test/html_test.exs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/html_test.exs b/test/html_test.exs
index 64513980b..b8906c46a 100644
--- a/test/html_test.exs
+++ b/test/html_test.exs
@@ -212,5 +212,21 @@ defmodule Pleroma.HTMLTest do
assert url == "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=72255140"
end
+
+ test "skips microformats hashtags" do
+ user = insert(:user)
+
+ {:ok, activity} =
+ CommonAPI.post(user, %{
+ "status" =>
+ "<a href=\"https://pleroma.gov/tags/cofe\" rel=\"tag\">#cofe</a> https://www.pixiv.net/member_illust.php?mode=medium&illust_id=72255140",
+ "content_type" => "text/html"
+ })
+
+ object = Object.normalize(activity)
+ {:ok, url} = HTML.extract_first_external_url(object, object.data["content"])
+
+ assert url == "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=72255140"
+ end
end
end