terminal-in-react
terminal-in-react copied to clipboard
Print urls as hyperlink
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?
Many Thanks π¨βπ»
+1, would also like to see this functionality!
:+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.