diff options
author | lambda <pleromagit@rogerbraun.net> | 2017-12-08 12:34:03 +0000 |
---|---|---|
committer | lambda <pleromagit@rogerbraun.net> | 2017-12-08 12:34:03 +0000 |
commit | 35cfbf43a00890fd23297fa6f67b23c415d32b04 (patch) | |
tree | c88cf1fb24304e44b45fefe7a3a41ece07498779 /test | |
parent | 40c30ab895af8bbc5a77feee39f86ada34ffcc88 (diff) | |
parent | a3e68f02330a3c38f1d3f568ad507e5111b82600 (diff) | |
download | pleroma-35cfbf43a00890fd23297fa6f67b23c415d32b04.tar.gz pleroma-35cfbf43a00890fd23297fa6f67b23c415d32b04.zip |
Merge branch 'fix/linkify' into 'develop'
Fix links with HTML elements and/or parentheses.
See merge request pleroma/pleroma!38
Diffstat (limited to 'test')
-rw-r--r-- | test/formatter_test.exs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs index f91973881..cb7695e8e 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -25,6 +25,16 @@ defmodule Pleroma.FormatterTest do expected = "<a href='http://www.cs.vu.nl/~ast/intel/'>http://www.cs.vu.nl/~ast/intel/</a>" assert Formatter.linkify(text) == expected + + text = "https://forum.zdoom.org/viewtopic.php?f=44&t=57087" + expected = "<a href='https://forum.zdoom.org/viewtopic.php?f=44&t=57087'>https://forum.zdoom.org/viewtopic.php?f=44&t=57087</a>" + + assert Formatter.linkify(text) == expected + + text = "https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul" + expected = "<a href='https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul'>https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul</a>" + + assert Formatter.linkify(text) == expected end end |