Skip to content

Commit 8dcc8ef

Browse files
author
Adam Cole
committed
add a couple specs to autolinker to test number only URLs
1 parent 6ad0059 commit 8dcc8ef

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/autolinker-url.spec.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,19 @@ describe( "Autolinker Url Matching -", () => {
9090
let result = autolinker.link( 'http://10.0.0.108:9000/' );
9191
expect( result ).toBe( '<a href="http://10.0.0.108:9000/">10.0.0.108:9000</a>' );
9292
} );
93-
93+
94+
95+
it( 'should link URLs with IP addresses but exclude trailing periods', function() {
96+
let result = autolinker.link( 'Joe went to http://66.102.7.147.' );
97+
expect( result ).toBe( 'Joe went to <a href="http://66.102.7.147">66.102.7.147</a>.' );
98+
} );
99+
100+
101+
it( 'should link protocol URLs that are only numbers', function() {
102+
let result = autolinker.link( 'Joe went to bugtracker://20012909' );
103+
expect( result ).toBe( 'Joe went to <a href="bugtracker://20012909">bugtracker://20012909</a>' );
104+
} );
105+
94106

95107
it( "should automatically link capitalized URLs", function() {
96108
let result = autolinker.link( "Joe went to HTTP://WWW.YAHOO.COM" );

0 commit comments

Comments
 (0)