MCPcopy Create free account
hub / github.com/deepnote/deepnote / finalizeCell

Function finalizeCell

packages/convert/src/percent-to-deepnote.ts:62–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 let currentContent: string[] = []
61
62 function finalizeCell() {
63 if (currentCell) {
64 // For markdown cells, strip the '# ' prefix from each line
65 if (currentCell.cellType === 'markdown') {
66 currentCell.content = currentContent
67 .map(line => {
68 if (line.startsWith('# ')) {
69 return line.slice(2)
70 }
71 if (line === '#') {
72 return ''
73 }
74 return line
75 })
76 .join('\n')
77 .trim()
78 } else {
79 currentCell.content = currentContent.join('\n').trim()
80 }
81 cells.push(currentCell)
82 }
83 currentContent = []
84 }
85
86 for (const line of lines) {
87 const match = cellMarkerRegex.exec(line)

Callers 1

parsePercentFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected