From 5573fe6d979735219d03d71beb5a26dddad69a5e Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 19 Nov 2020 19:30:20 +0000 Subject: [PATCH] Test IDN and punycode domains in mentions --- test/linkify_test.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/linkify_test.exs b/test/linkify_test.exs index 32df145..3d9bf55 100644 --- a/test/linkify_test.exs +++ b/test/linkify_test.exs @@ -392,6 +392,20 @@ defmodule LinkifyTest do assert Linkify.link(text, mention: true, mention_prefix: "/users/") == text end + + test "IDN domain" do + text = "hello @lain@我爱你.com" + + expected = "hello @lain@我爱你.com" + + assert Linkify.link(text, mention: true, mention_prefix: "/users/") == expected + + text = "hello @lain@xn--6qq986b3xl.com" + + expected = "hello @lain@xn--6qq986b3xl.com" + + assert Linkify.link(text, mention: true, mention_prefix: "/users/") == expected + end end describe "hashtag links" do