Skip to content

Conversation

speedytwenty
Copy link
Collaborator

@speedytwenty speedytwenty commented Apr 5, 2022

This PR adds support for hyperlinks using a very simple interface. This feature was requested in #73

table.push([
  // Specify the URL as the display text
  { href: 'http://example.com' }, 
  // Specify display text
  { href: 'http://example.com', content: 'Example text' },
]);

Link text is wrapped, truncated, etc. as usual but when the text of a cell spans multiple lines, each line is wrapped with the link.

PR includes:

  • Added utils.hyplerink() with unit tests (with credits to @matheussampaio)
  • Added hyperlink support to Cell with functional tests that generate documentation
  • Updated documentation basic-usage.md

The difference in functionality is not meaningfully demonstrable in markdown. Examine the (failing/passing) tests in Checks to inspect the differences.

@speedytwenty speedytwenty linked an issue Apr 5, 2022 that may be closed by this pull request
@speedytwenty speedytwenty marked this pull request as ready for review April 5, 2022 03:47
@speedytwenty speedytwenty merged commit ed4afb7 into cli-table:master Apr 5, 2022
@speedytwenty speedytwenty added the enhancement New feature or request label Apr 5, 2022
@speedytwenty speedytwenty deleted the issue-73 branch April 16, 2022 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link as hyperlink in terminal doesn't render correctly

1 participant