logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker git clone https://hacktivis.me/git/auto_linker.git
commit: c14ac019af18a7a3c96206b9d7f752de2e8ae783
parent 649fc9125daaef03abdba867f600ed398bd5c5b0
Author: Mark Felder <feld@FreeBSD.org>
Date:   Thu, 19 Nov 2020 18:13:55 +0000

Add IDN and punycode domain test

Diffstat:

Mtest/linkify_test.exs14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/test/linkify_test.exs b/test/linkify_test.exs @@ -668,5 +668,19 @@ defmodule LinkifyTest do assert Linkify.link(text) == expected end + + test "IDN and punycode domain" do + text = "FrauBücher.com says Neiiighhh!" + + expected = "<a href=\"http://FrauBücher.com\">FrauBücher.com</a> says Neiiighhh!" + + assert Linkify.link(text) == expected + + text = "xn--fraubcher-u9a.com says Neiiighhh!" + + expected = "<a href=\"http://xn--fraubcher-u9a.com\">xn--fraubcher-u9a.com</a> says Neiiighhh!" + + assert Linkify.link(text) == expected + end end end