File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,25 @@ describe( "Autolinker", function() {
295
295
expect ( result ) . toBe ( 'Joe went to <a href="https://ru.wikipedia.org/wiki/Кириллица?Кириллица=1#Кириллица">ru.wikipedia.org/wiki/Кириллица?Кириллица=1#Кириллица</a>' ) ;
296
296
} ) ;
297
297
298
+
299
+ it ( 'should match local urls with numbers when prefixed with http://' , function ( ) {
300
+ var result1 = autolinker . link ( 'http://localhost.local001/test' ) ;
301
+ expect ( result1 ) . toBe ( '<a href="http://localhost.local001/test">localhost.local001/test</a>' ) ;
302
+
303
+ var result2 = autolinker . link ( 'http://suus111.w10:8090/display/test/AI' ) ;
304
+ expect ( result2 ) . toBe ( '<a href="http://suus111.w10:8090/display/test/AI">suus111.w10:8090/display/test/AI</a>' ) ;
305
+ } ) ;
306
+
307
+
308
+ it ( 'should not match local urls with numbers when NOT prefixed with http://' , function ( ) {
309
+ var result1 = autolinker . link ( 'localhost.local001/test' ) ;
310
+ expect ( result1 ) . toBe ( 'localhost.local001/test' ) ;
311
+
312
+ var result2 = autolinker . link ( 'suus111.w10:8090/display/test/AI' ) ;
313
+ expect ( result2 ) . toBe ( 'suus111.w10:8090/display/test/AI' ) ;
314
+ } ) ;
315
+
316
+
298
317
it ( 'should not match an address with multiple dots' , function ( ) {
299
318
expect ( autolinker . link ( 'hello:...world' ) ) . toBe ( 'hello:...world' ) ;
300
319
expect ( autolinker . link ( 'hello:wo.....rld' ) ) . toBe ( 'hello:wo.....rld' ) ;
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ describe( "Autolinker.matcher.Url", function() {
95
95
} ) ;
96
96
97
97
98
- it ( 'should match any local URL with http before' , function ( ) {
98
+ it ( 'should match any local URL with numbers with http:// before' , function ( ) {
99
99
var matches = matcher . parseMatches ( 'http://localhost.local001/test' ) ;
100
100
var othermatches = matcher . parseMatches ( 'http://suus111.w10:8090/display/test/AI' ) ;
101
101
@@ -105,7 +105,8 @@ describe( "Autolinker.matcher.Url", function() {
105
105
MatchChecker . expectUrlMatch ( othermatches [ 0 ] , 'http://suus111.w10:8090/display/test/AI' , 0 ) ;
106
106
} ) ;
107
107
108
- it ( 'should not match a local URL that does not have the http before' , function ( ) {
108
+
109
+ it ( 'should not match a local URL with numbers that does not have the http:// before' , function ( ) {
109
110
var matches = matcher . parseMatches ( 'localhost.local001/test' ) ;
110
111
111
112
expect ( matches . length ) . toBe ( 0 ) ;
You can’t perform that action at this time.
0 commit comments