about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-06-23 22:42:34 +0000
committerEric Wong <e@80x24.org>2017-06-23 22:44:52 +0000
commitdfdaf74a2ab6d694315d8f636e3771a7a7934f3f (patch)
tree2caa9cd27b9bbf5020ea1a4b3b4d3bd2d47c4345 /t
parent1a8eb0a43c68e64b77fdd3c4ebd977a1ab88e71b (diff)
downloadpublic-inbox-dfdaf74a2ab6d694315d8f636e3771a7a7934f3f.tar.gz
Sometimes, URLs exist at the end of parethesized statements,
and we shouldn't unnecessarily capture that.

(example: https://public-inbox.org/ruby-core/20170623032722.GA8124@dcvr/)
Diffstat (limited to 't')
-rw-r--r--t/linkify.t10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/linkify.t b/t/linkify.t
index 99acf17d..041c15c7 100644
--- a/t/linkify.t
+++ b/t/linkify.t
@@ -14,6 +14,16 @@ use PublicInbox::Linkify;
         is($s, qq(<a\nhref="$u">$u</a>.), 'trailing period not in URL');
 }
 
+# handle URLs in parenthesized statements
+{
+        my $l = PublicInbox::Linkify->new;
+        my $u = 'http://example.com/';
+        my $s = "(see: $u)";
+        $s = $l->linkify_1($s);
+        $s = $l->linkify_2($s);
+        is($s, qq{(see: <a\nhref="$u">$u</a>)}, 'trailing ) not in URL');
+}
+
 {
         my $l = PublicInbox::Linkify->new;
         my $u = 'http://example.com/url-with-trailing-semicolon';