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
This commit is contained in:
commit
d0b781ab69
3 changed files with 21 additions and 2 deletions
|
|
@ -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:"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue