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

(v2) feat: add hyperlink support #473

Open
wants to merge 1 commit into
base: v2-exp
Choose a base branch
from
Open

Conversation

aymanbagabas
Copy link
Member

@aymanbagabas aymanbagabas commented Feb 12, 2025

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!")
}

@meowgorithm
Copy link
Member

This could probably also benefit from an UnsetHyperlink test too.

@aymanbagabas aymanbagabas force-pushed the v2-hyperlinks branch 2 times, most recently from 82d48d6 to d271f7f Compare February 18, 2025 20:06
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants