Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

href breaks when content is truncated #338

Closed
ItsNickBarry opened this issue Apr 21, 2024 · 1 comment · Fixed by #342
Closed

href breaks when content is truncated #338

ItsNickBarry opened this issue Apr 21, 2024 · 1 comment · Fixed by #342
Labels
bug Something isn't working

Comments

@ItsNickBarry
Copy link
Contributor

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 speedytwenty added the bug Something isn't working label Apr 23, 2024
@speedytwenty
Copy link
Collaborator

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

ItsNickBarry added a commit to ItsNickBarry/cli-table3 that referenced this issue Apr 23, 2024
ItsNickBarry added a commit to ItsNickBarry/cli-table3 that referenced this issue Apr 23, 2024
speedytwenty pushed a commit that referenced this issue May 12, 2024
* add failing test for #338

* quick fix #338

* test full truncated href table output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants