MCPcopy Index your code
hub / github.com/codeaashu/claude-code / createHyperlink

Function createHyperlink

src/utils/hyperlink.ts:24–39  ·  view source on GitHub ↗
(
  url: string,
  content?: string,
  options?: HyperlinkOptions,
)

Source from the content-addressed store, hash-verified

22 * @param options - Optional overrides for testing (supportsHyperlinks)
23 */
24export function createHyperlink(
25 url: string,
26 content?: string,
27 options?: HyperlinkOptions,
28): string {
29 const hasSupport = options?.supportsHyperlinks ?? supportsHyperlinks()
30 if (!hasSupport) {
31 return url
32 }
33
34 // Apply basic ANSI blue color - wrap-ansi preserves this across line breaks
35 // RGB colors (like theme colors) are NOT preserved by wrap-ansi with OSC 8
36 const displayText = content ?? url
37 const coloredText = chalk.blue(displayText)
38 return `${OSC8_START}${url}${OSC8_END}${coloredText}${OSC8_START}${OSC8_END}`
39}
40

Callers 4

renderToolResultMessageFunction · 0.85
linkifyUrlsInTextFunction · 0.85
formatTokenFunction · 0.85
linkifyIssueReferencesFunction · 0.85

Calls 1

supportsHyperlinksFunction · 0.85

Tested by

no test coverage detected