Skip to content

Commit 87f2ef6

Browse files
committed
add test to not strip non-http protocols
1 parent 29f7d19 commit 87f2ef6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/AutolinkerTest.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ Ext.test.Session.addSuite( new Ext.test.Suite( {
236236

237237
// Test the 'stripPrefix' option
238238

239+
"link() should not remove the prefix for non-http protocols" : function() {
240+
var result = Autolinker.link( "Test file://execute-virus.com" );
241+
Y.Assert.areSame( 'Test <a href="file://execute-virus.com" target="_blank">file://execute-virus.com</a>', result );
242+
},
243+
239244
"link() should not remove 'http://www.' when the 'stripPrefix' option is set to false" : function() {
240245
var result = Autolinker.link( "Test http://www.url.com", { stripPrefix: false } );
241246
Y.Assert.areSame( 'Test <a href="http://www.url.com" target="_blank">http://www.url.com</a>', result );

0 commit comments

Comments
 (0)