terminal-in-react icon indicating copy to clipboard operation
terminal-in-react copied to clipboard

Print urls as hyperlink

Open SachaIZADI opened this issue 5 years ago β€’ 2 comments

Hi Nitin,

Thanks a lot for releasing this package, it is really neat!

I've played around with the Terminal component and implemented a HackerNews reader. I thought it could be nice to display url as a clickable hyperlink when calling print. It's not something already implemented right?

Capture d’écran 2019-12-08 aΜ€ 11 57 58 PM

Many Thanks πŸ‘¨β€πŸ’»

SachaIZADI avatar Dec 08 '19 23:12 SachaIZADI

+1, would also like to see this functionality!

xlanor avatar Feb 26 '20 07:02 xlanor

:+1: for this.

Implementation thoughts:

Since all that content is just a string, one approach would be to regex replace urls with hyperlinks.

Those regexes can get pretty hairy, though, and usually don't cover every use case. We could likely save a few different ones as consts, and allow the user to override/add to them.

Anyway, just take that string and replace with it with a component that renders the text, but adds the links as well.

jethrodaniel avatar Apr 04 '20 18:04 jethrodaniel