diff --git a/src/Autolinker.js b/src/Autolinker.js index fe53cc8b..0043ab94 100644 --- a/src/Autolinker.js +++ b/src/Autolinker.js @@ -605,19 +605,19 @@ Autolinker.prototype = { matches = []; // Find all matches within the `textOrHtml` (but not matches that are - // already nested within tags) + // already nested within , or tag anchorTagStackCount = Math.max( anchorTagStackCount - 1, 0 ); // attempt to handle extraneous tags by making sure the stack count never goes below 0 } - } else if( nodeType === 'text' && anchorTagStackCount === 0 ) { // Process text nodes that are not within an tag + } else if( nodeType === 'text' && anchorTagStackCount === 0 ) { // Process text nodes that are not within an , tags' ); + expect( result ).toBe( 'Testing with tags' ); + } ); + + + it( "should NOT automatically link a URL found within the inner text of a script tag", function() { + var result = autolinker.link( 'Testing with tags' ); + expect( result ).toBe( 'Testing with tags' ); + } ); + + it( "should NOT automatically link an image tag with a URL inside of it, when it has another attribute which has extraneous spaces surround its value (Issue #45)", function() { var result = autolinker.link( "Testing " ); expect( result ).toBe( "Testing " );