File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Autolinker.js
2
2
3
3
![ version] ( https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fgregjacobs%2FAutolinker.js%2Frefs%2Fheads%2Fmaster%2Fpackage.json&query=%24.version&label=Version )
4
- [ ![ build] ( https://github.com/gregjacobs/Autolinker.js/actions/workflows/main.yml/badge.svg )] ( https://github.com/gregjacobs/Autolinker.js/actions/workflows/main.yml )
5
4
[ ![ NPM Downloads] ( https://img.shields.io/npm/dw/autolinker )] ( https://www.npmjs.com/package/autolinker )
6
- [ ![ GitHub License ] ( https://img.shields.io/github/license/ gregjacobs/Autolinker.js )] ( https://github.com/gregjacobs/Autolinker.js/blob/master/LICENSE )
5
+ [ ![ build ] ( https://github.com/ gregjacobs/Autolinker.js/actions/workflows/main.yml/badge.svg )] ( https://github.com/gregjacobs/Autolinker.js/actions/workflows/main.yml )
7
6
[ ![ codecov] ( https://codecov.io/github/gregjacobs/Autolinker.js/graph/badge.svg?token=6sqLqa2oeb )] ( https://codecov.io/github/gregjacobs/Autolinker.js )
7
+ [ ![ GitHub License] ( https://img.shields.io/github/license/gregjacobs/Autolinker.js )] ( https://github.com/gregjacobs/Autolinker.js/blob/master/LICENSE )
8
8
9
9
Because I had so much trouble finding a good auto-linking implementation out in
10
10
the wild, I decided to roll my own. It seemed that everything I found out there
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ describe('Truncate.truncate.truncateSmart', function () {
21
21
expect ( truncatedUrl . length ) . to . equal ( 72 ) ;
22
22
} ) ;
23
23
24
+ it ( `when just a scheme+hostname present and it's exactly the truncate length, should return it as-is` , ( ) => {
25
+ const truncatedUrl = truncateSmart ( 'http://yahoo.com' , 'http://yahoo.com' . length , '..' ) ;
26
+
27
+ expect ( truncatedUrl ) . to . equal ( 'http://yahoo.com' ) ;
28
+ } ) ;
29
+
24
30
it ( `when just a hostname is present and it's exactly the truncate length, should return it as-is` , ( ) => {
25
31
const truncatedUrl = truncateSmart ( 'yahoo.com' , 'yahoo.com' . length , '..' ) ;
26
32
You can’t perform that action at this time.
0 commit comments