summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2018-08-16 15:41:16 +0000
committerkaniini <nenolod@gmail.com>2018-08-16 15:41:16 +0000
commit183ccd18127c657e957f40de43ca309434b2180b (patch)
tree9be5f0c898307f01d25c7e347c4afd79aec7be23 /test
parentc004b6ea0a172b3c2a27c40a114d7a67f6d63a9c (diff)
parentd5091c3175786e5bcb0449f26cafe1795fd5f5d9 (diff)
downloadpleroma-183ccd18127c657e957f40de43ca309434b2180b.tar.gz
pleroma-183ccd18127c657e957f40de43ca309434b2180b.zip
Merge branch 'dev-lanodan-url-regex' into 'develop'
lib/pleroma/formatter.ex: Fix URL regex Closes #127 See merge request pleroma/pleroma!69
Diffstat (limited to 'test')
-rw-r--r--test/formatter_test.exs10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index c2b3d4ac0..abbd7ac93 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -20,10 +20,10 @@ defmodule Pleroma.FormatterTest do
describe ".add_links" do
test "turning urls into links" do
- text = "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla."
+ text = "Hey, check out https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&y=2#blabla ."
expected =
- "Hey, check out <a href=\"https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&amp;y=2#blabla\">https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&amp;y=2#blabla</a>."
+ "Hey, check out <a href=\"https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&amp;y=2#blabla\">https://www.youtube.com/watch?v=8Zg1-TufF%20zY?x=1&amp;y=2#blabla</a> ."
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
@@ -85,6 +85,12 @@ defmodule Pleroma.FormatterTest do
"<a href=\"https://pleroma.com\">https://pleroma.com</a> <a href=\"https://pleroma.com/sucks\">https://pleroma.com/sucks</a>"
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
+
+ text = "xmpp:contact@hacktivis.me"
+
+ expected = "<a href=\"xmpp:contact@hacktivis.me\">xmpp:contact@hacktivis.me</a>"
+
+ assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
end
end