MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / renderLink

Function renderLink

cli/src/utils/markdown-renderer.tsx:630–644  ·  view source on GitHub ↗
(link: Link, state: RenderState)

Source from the content-addressed store, hash-verified

628}
629
630const renderLink = (link: Link, state: RenderState): ReactNode[] => {
631 const { palette, nextKey } = state
632 const labelNodes = renderNodes(
633 link.children as MarkdownNode[],
634 state,
635 link.type,
636 )
637 const label = labelNodes.length > 0 ? labelNodes : [link.url]
638
639 return [
640 <span key={nextKey()} fg={palette.linkFg}>
641 {wrapSegmentsInFragments(label, nextKey())}
642 </span>,
643 ]
644}
645
646/**
647 * Wraps text to fit within a specified width, returning an array of lines.

Callers 1

renderNodeFunction · 0.85

Calls 2

renderNodesFunction · 0.85
wrapSegmentsInFragmentsFunction · 0.85

Tested by

no test coverage detected