feat: render Markdown links as OSC 8 hyperlinks in help text
What does this MR do and why?
Adds support for clickable terminal hyperlinks in glab help text.
When command Long descriptions or Example fields contain markdown links ([text](url)), they previously appeared as raw markdown syntax in the terminal. For example, [GitLab REST API documentation](https://docs.gitlab.com/api/).
This MR converts those markdown links to OSC 8 hyperlinks before Fang renders help output. OSC 8 is the terminal standard for clickable links, supported by iTerm2, Kitty, WezTerm, GNOME Terminal, Windows Terminal, and others. In terminals that do not support OSC 8, the sequences are silently ignored and only the link text is shown. When output is piped or redirected, Fang's colorprofile.Writer strips the sequences automatically.
Implementation
A conversion function is added to internal/text:
ConvertMarkdownLinks(s string, linkFormatter func(displayText, url string) string) string: Converts[text](url)to whatever formatlinkFormatterproduces. Inglab, the formatter isIOStreams.Hyperlink, which emits OSC 8 sequences when the terminal supports them and falls back to plain display text otherwise.
In cmd/glab/main.go, a preprocessCommandLinks helper walks the full command tree immediately before fang.Execute is called, converting Long and Example fields in place.
No per-command changes are required. Any command that already uses [text](url) syntax in its description or examples gets clickable links.
How to test
Build and run any command that has markdown links in its Long description, for example:
go build ./cmd/glab/... && GLAB_FORCE_HYPERLINKS=1 ./glab api --helpThe "GitLab REST API documentation" and "GitLab GraphQL documentation" lines in the synopsis should appear underlined and clickable. Hovering over them should show the target URL.
To verify graceful degradation when piped:
GLAB_FORCE_HYPERLINKS=1 ./glab api --help 2>/dev/null | cat -v | grep "REST API"This should output plain text with no escape sequences.
