Skip to content

Commit

Permalink
add test to not strip non-http protocols
Browse files Browse the repository at this point in the history
(cherry picked from commit 87f2ef6)
  • Loading branch information
afeld committed Jan 2, 2014
1 parent e6b4ab2 commit a88a8a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/AutolinkerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ Ext.test.Session.addSuite( new Ext.test.Suite( {

// Test the 'stripPrefix' option

"link() should not remove the prefix for non-http protocols" : function() {
var result = Autolinker.link( "Test file://execute-virus.com" );
Y.Assert.areSame( 'Test <a href="file://execute-virus.com" target="_blank">file://execute-virus.com</a>', result );
},

"link() should not remove 'http://www.' when the 'stripPrefix' option is set to false" : function() {
var result = Autolinker.link( "Test http://www.url.com", { stripPrefix: false } );
Y.Assert.areSame( 'Test <a href="http://www.url.com" target="_blank">http://www.url.com</a>', result );
Expand Down

0 comments on commit a88a8a9

Please sign in to comment.