cli-table / cli-table3

Pretty unicode tables for the command line
MIT License
515 stars 44 forks source link

`href` breaks when `content` is truncated #338

Closed ItsNickBarry closed 2 months ago

ItsNickBarry commented 3 months ago

Truncated hrefs turn everything that follows into a link. In this reproduction example, the third table row is included because it prevents the href from the first row from ruining the entire terminal window.

const Table = require('cli-table3');

const table = new Table({
  colWidths: [10],
  style: { border: [], head: [] },
});

const href = 'http://example.com';

table.push([{ content: 'looooooooooooong', href }]);
table.push([{ content: 'not href' }]);
table.push([{ content: 'short', href }]);

console.log(table.toString());
speedytwenty commented 3 months ago

Thanks for the report. I don't foresee being able to address this anytime soon, however. A PR with a failing test would help expedite the effort.

Examples of issue based tests can be found here: https://github.com/cli-table/cli-table3/tree/master/test/issues