(block: DeepnoteBlock)
| 10 | import type { DeepnoteBlock } from './deepnote-file/deepnote-file-schema' |
| 11 | |
| 12 | export function createMarkdown(block: DeepnoteBlock): string { |
| 13 | if (block.type === 'markdown') { |
| 14 | return block.content ?? '' |
| 15 | } |
| 16 | |
| 17 | if (isTextBlock(block)) { |
| 18 | return createMarkdownForTextBlock(block) |
| 19 | } |
| 20 | |
| 21 | if (isSeparatorBlock(block)) { |
| 22 | return createMarkdownForSeparatorBlock(block) |
| 23 | } |
| 24 | |
| 25 | if (isImageBlock(block)) { |
| 26 | return createMarkdownForImageBlock(block) |
| 27 | } |
| 28 | |
| 29 | throw new UnsupportedBlockTypeError(`Creating markdown from block type ${block.type} is not supported yet.`) |
| 30 | } |
| 31 | |
| 32 | export function stripMarkdown(block: DeepnoteBlock): string { |
| 33 | if (isTextBlock(block)) { |
no test coverage detected