Skip to content

Commit

Permalink
Fix broken link escapes (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodepalo committed Sep 9, 2023
1 parent 9ff9ef9 commit adc2c0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -43,7 +43,7 @@
"text"
],
"dependencies": {
"@alcalzone/ansi-tokenize": "^0.1.2",
"@alcalzone/ansi-tokenize": "^0.1.3",
"ansi-escapes": "^6.0.0",
"auto-bind": "^5.0.1",
"chalk": "^5.2.0",
Expand Down
9 changes: 9 additions & 0 deletions test/components.tsx
Expand Up @@ -3,6 +3,7 @@ import test from 'ava';
import chalk from 'chalk';
import React, {Component, useState} from 'react';
import {spy} from 'sinon';
import ansiEscapes from 'ansi-escapes';
import {
Box,
Newline,
Expand Down Expand Up @@ -720,3 +721,11 @@ test('vertical spacer', t => {

t.is(output, 'Top\n\n\n\n\nBottom');
});

test('link ansi escapes are closed properly', t => {
const output = renderToString(
<Text>{ansiEscapes.link('Example', 'https://example.com')}</Text>
);

t.is(output, ']8;;https://example.comExample]8;;');
});

0 comments on commit adc2c0c

Please sign in to comment.