Skip to content

Commit adc2c0c

Browse files
authored
Fix broken link escapes (#623)
1 parent 9ff9ef9 commit adc2c0c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"text"
4444
],
4545
"dependencies": {
46-
"@alcalzone/ansi-tokenize": "^0.1.2",
46+
"@alcalzone/ansi-tokenize": "^0.1.3",
4747
"ansi-escapes": "^6.0.0",
4848
"auto-bind": "^5.0.1",
4949
"chalk": "^5.2.0",

Diff for: test/components.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import test from 'ava';
33
import chalk from 'chalk';
44
import React, {Component, useState} from 'react';
55
import {spy} from 'sinon';
6+
import ansiEscapes from 'ansi-escapes';
67
import {
78
Box,
89
Newline,
@@ -720,3 +721,11 @@ test('vertical spacer', t => {
720721

721722
t.is(output, 'Top\n\n\n\n\nBottom');
722723
});
724+
725+
test('link ansi escapes are closed properly', t => {
726+
const output = renderToString(
727+
<Text>{ansiEscapes.link('Example', 'https://example.com')}</Text>
728+
);
729+
730+
t.is(output, ']8;;https://example.comExample]8;;');
731+
});

0 commit comments

Comments
 (0)