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

Function splitNodesByNewline

cli/src/utils/markdown-renderer.tsx:165–183  ·  view source on GitHub ↗
(nodes: ReactNode[])

Source from the content-addressed store, hash-verified

163}
164
165const splitNodesByNewline = (nodes: ReactNode[]): ReactNode[][] => {
166 const lines: ReactNode[][] = [[]]
167 nodes.forEach((node) => {
168 if (typeof node === 'string') {
169 const parts = node.split('\n')
170 parts.forEach((part, idx) => {
171 if (part.length > 0) {
172 lines[lines.length - 1].push(part)
173 }
174 if (idx < parts.length - 1) {
175 lines.push([])
176 }
177 })
178 } else {
179 lines[lines.length - 1].push(node)
180 }
181 })
182 return lines
183}
184
185const hasUnescapedMarker = (value: string): boolean => {
186 if (!value) {

Callers 1

renderBlockquoteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected