Test IDN and punycode domains in mentions
This commit is contained in:
parent
3ce2c34709
commit
5573fe6d97
1 changed files with 14 additions and 0 deletions
|
@ -392,6 +392,20 @@ defmodule LinkifyTest do
|
||||||
|
|
||||||
assert Linkify.link(text, mention: true, mention_prefix: "/users/") == text
|
assert Linkify.link(text, mention: true, mention_prefix: "/users/") == text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "IDN domain" do
|
||||||
|
text = "hello @lain@我爱你.com"
|
||||||
|
|
||||||
|
expected = "hello <a href=\"/users/lain@我爱你.com\">@lain@我爱你.com</a>"
|
||||||
|
|
||||||
|
assert Linkify.link(text, mention: true, mention_prefix: "/users/") == expected
|
||||||
|
|
||||||
|
text = "hello @lain@xn--6qq986b3xl.com"
|
||||||
|
|
||||||
|
expected = "hello <a href=\"/users/lain@xn--6qq986b3xl.com\">@lain@xn--6qq986b3xl.com</a>"
|
||||||
|
|
||||||
|
assert Linkify.link(text, mention: true, mention_prefix: "/users/") == expected
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "hashtag links" do
|
describe "hashtag links" do
|
||||||
|
|
Reference in a new issue