MCPcopy Index your code
hub / github.com/deepnote/deepnote / addMarkdownCells

Function addMarkdownCells

packages/convert/src/quarto-to-deepnote.ts:126–138  ·  view source on GitHub ↗

* Splits markdown content at cell delimiter comments and adds each part as a separate cell. * The delimiter `<!-- cell -->` is used to preserve cell boundaries during roundtrip conversion.

(cells: QuartoCell[], content: string)

Source from the content-addressed store, hash-verified

124 * The delimiter `<!-- cell -->` is used to preserve cell boundaries during roundtrip conversion.
125 */
126function addMarkdownCells(cells: QuartoCell[], content: string): void {
127 // Split at cell delimiter, preserving cell boundaries
128 const parts = content.split(/\s*<!--\s*cell\s*-->\s*/)
129 for (const part of parts) {
130 const trimmed = part.trim()
131 if (trimmed) {
132 cells.push({
133 cellType: 'markdown',
134 content: trimmed,
135 })
136 }
137 }
138}
139
140/**
141 * Parses YAML frontmatter string into a QuartoFrontmatter object.

Callers 1

parseQuartoFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected