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

Function renderBlockquote

cli/src/utils/markdown-renderer.tsx:512–546  ·  view source on GitHub ↗
(
  blockquote: Blockquote,
  state: RenderState,
)

Source from the content-addressed store, hash-verified

510}
511
512const renderBlockquote = (
513 blockquote: Blockquote,
514 state: RenderState,
515): ReactNode[] => {
516 const { palette, nextKey } = state
517 const childNodes = renderNodes(
518 blockquote.children as MarkdownNode[],
519 state,
520 blockquote.type,
521 )
522 const lines = splitNodesByNewline(childNodes)
523 const nodes: ReactNode[] = []
524
525 lines.forEach((line, index) => {
526 if (line.length === 0) {
527 return
528 }
529 nodes.push(
530 <span key={nextKey()} fg={palette.blockquoteBorderFg}>
531 {'> '}
532 </span>,
533 )
534 nodes.push(
535 <span key={nextKey()} fg={palette.blockquoteTextFg}>
536 {wrapSegmentsInFragments(line, nextKey())}
537 </span>,
538 )
539 if (index < lines.length - 1) {
540 nodes.push('\n')
541 }
542 })
543
544 nodes.push('\n\n')
545 return nodes
546}
547
548const renderList = (list: List, state: RenderState): ReactNode[] => {
549 const { palette, nextKey } = state

Callers 1

renderNodeFunction · 0.85

Calls 3

renderNodesFunction · 0.85
splitNodesByNewlineFunction · 0.85
wrapSegmentsInFragmentsFunction · 0.85

Tested by

no test coverage detected