Skip to content

Commit e76c3d5

Browse files
committed
Add test for hashtag that is longer than 15 characters.
Original version of hashtag implementation limited hashtags to 15 chars. Now the value is 139 chars.
1 parent d231dbb commit e76c3d5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/AutolinkerSpec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,13 @@ describe( "Autolinker", function() {
950950
} );
951951

952952

953+
it( "should automatically link hashtags that are longer than 15 chars (original version of hashtag implementation limited to 15 chars, now it's at 139 chars)", function() {
954+
var result = twitterHashtagAutolinker.link( "my hashtag is #AHashtagThatIsWorthyOfMordorAndStuff these days" );
955+
956+
expect( result ).toBe( 'my hashtag is <a href="https://twitter.com/hashtag/AHashtagThatIsWorthyOfMordorAndStuff">#AHashtagThatIsWorthyOfMordorAndStuff</a> these days' );
957+
} );
958+
959+
953960
it( "should NOT automatically link a hashtag when the '#' belongs to part of another string", function() {
954961
var result = twitterHashtagAutolinker.link( "test as#df test" );
955962

0 commit comments

Comments
 (0)