lipgloss
lipgloss copied to clipboard
(v2) feat: add hyperlink support
This commit adds support for hyperlinks in lipgloss. Hyperlinks are useful for rendering text that can be clicked on in a terminal emulator that supports hyperlinks.
Example:
package main
import (
"fmt"
"github.com/charmbracelet/lipgloss/v2"
)
func main() {
// Underline and color hyperlink
style := lipgloss.NewStyle().Underline(true).Foreground(lipgloss.Blue).Hyperlink("https://charm.sh")
fmt.Println("Welcome to the", style.Render("Charm"), "website!")
}
This could probably also benefit from an UnsetHyperlink test too.