Skip to content

Commit

Permalink
Add support for terminal link (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored and sindresorhus committed Mar 8, 2019
1 parent 841f0c4 commit 41b0a8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -43,7 +43,7 @@
"text"
],
"dependencies": {
"ansi-regex": "^4.0.0"
"ansi-regex": "^4.1.0"
},
"devDependencies": {
"ava": "^0.25.0",
Expand Down
3 changes: 3 additions & 0 deletions readme.md
Expand Up @@ -30,6 +30,9 @@ const stripAnsi = require('strip-ansi');

stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'

stripAnsi('\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007');
//=> 'Click'
```


Expand Down
4 changes: 4 additions & 0 deletions test.js
Expand Up @@ -12,3 +12,7 @@ test('strip color from ls command', t => {
test('strip reset;setfg;setbg;italics;strike;underline sequence from string', t => {
t.is(stripAnsi('\u001B[0;33;49;3;9;4mbar\u001B[0m'), 'bar');
});

test('strip link from terminal link', t => {
t.is(stripAnsi('\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'), 'click');
});

0 comments on commit 41b0a8b

Please sign in to comment.