diff options
author | lain <lain@soykaf.club> | 2023-02-09 21:25:15 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2023-02-09 21:25:15 +0000 |
commit | d0b781ab69971a6a950a8bcb36f5702dc999e209 (patch) | |
tree | c74312eefaaf698e5c25b337e152187b78f07650 /test | |
parent | 7abb248cebaa10edfad34f304eb929d654956a54 (diff) | |
parent | 7138910f30ec401bb7327efb57351ae0f399bfb7 (diff) | |
download | pleroma-d0b781ab69971a6a950a8bcb36f5702dc999e209.tar.gz pleroma-d0b781ab69971a6a950a8bcb36f5702dc999e209.zip |
Merge branch 'from/upstream-develop/tusooa/2974-zwnj' into 'develop'
Bump linkify - Fix zwnj in tags and double-dot links
Closes #2974 and #3022
See merge request pleroma/pleroma!3830
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/common_api_test.exs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index 44355c26d..5c9103e9f 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -518,6 +518,25 @@ defmodule Pleroma.Web.CommonAPITest do assert Object.tags(object) == ["2hu"] end + test "zwnj is treated as word character" do + user = insert(:user) + {:ok, activity} = CommonAPI.post(user, %{status: "#ساٴينس"}) + + object = Object.normalize(activity, fetch: false) + + assert Object.tags(object) == ["ساٴينس"] + end + + test "double dot in link is allowed" do + user = insert(:user) + text = "https://example.to/something..mp3" + {:ok, activity} = CommonAPI.post(user, %{status: text}) + + object = Object.normalize(activity, fetch: false) + + assert object.data["content"] == "<a href=\"#{text}\" rel=\"ugc\">#{text}</a>" + end + test "it adds emoji in the object" do user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{status: ":firefox:"}) |