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

Function renderHeading

cli/src/utils/markdown-renderer.tsx:592–610  ·  view source on GitHub ↗
(heading: Heading, state: RenderState)

Source from the content-addressed store, hash-verified

590}
591
592const renderHeading = (heading: Heading, state: RenderState): ReactNode[] => {
593 const { palette, nextKey } = state
594 const depth = Math.max(1, Math.min(heading.depth, 6))
595 const color = palette.headingFg[depth] ?? palette.headingFg[6]
596 const childNodes = renderNodes(
597 heading.children as MarkdownNode[],
598 state,
599 heading.type,
600 )
601
602 return [
603 <span key={nextKey()} fg={color} attributes={TextAttributes.BOLD}>
604 {childNodes.map((segment, idx) => (
605 <KeyedFragment key={nextKey() + '-' + idx}>{segment}</KeyedFragment>
606 ))}
607 </span>,
608 '\n\n',
609 ]
610}
611
612const renderInlineCode = (
613 inlineCode: InlineCode,

Callers 1

renderNodeFunction · 0.85

Calls 1

renderNodesFunction · 0.85

Tested by

no test coverage detected