MCPcopy Create free account
hub / github.com/Noumena-Network/code / appendTableContinuation

Function appendTableContinuation

src/utils/markdown.ts:196–209  ·  view source on GitHub ↗
(row: string, continuation: string)

Source from the content-addressed store, hash-verified

194}
195
196function appendTableContinuation(row: string, continuation: string): string {
197 const trimmedRow = row.trimEnd()
198 const trimmedContinuation = continuation.trim()
199 const rowCells = splitPipeCells(trimmedRow)
200 const continuationCells = splitPipeCells(trimmedContinuation)
201 const needsMissingSeparator =
202 !trimmedRow.endsWith('|') &&
203 rowCells.length > 0 &&
204 continuationCells.length > 1
205
206 return needsMissingSeparator
207 ? `${trimmedRow} | ${trimmedContinuation}`
208 : `${trimmedRow} ${trimmedContinuation}`
209}
210
211function closeRepairedTableRow(row: string): string {
212 return row.trimEnd().endsWith('|') ? row.trimEnd() : `${row.trimEnd()} |`

Callers 1

Calls 1

splitPipeCellsFunction · 0.85

Tested by

no test coverage detected