diff options
author | Eric Wong <e@80x24.org> | 2017-06-23 22:42:34 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-06-23 22:44:52 +0000 |
commit | dfdaf74a2ab6d694315d8f636e3771a7a7934f3f (patch) | |
tree | 2caa9cd27b9bbf5020ea1a4b3b4d3bd2d47c4345 /t | |
parent | 1a8eb0a43c68e64b77fdd3c4ebd977a1ab88e71b (diff) | |
download | public-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.t | 10 |
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'; |