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

Function isTextBlock

packages/blocks/src/blocks/text-blocks.ts:79–91  ·  view source on GitHub ↗
(block: DeepnoteBlock)

Source from the content-addressed store, hash-verified

77export type HeadingTextBlockType = 'text-cell-h1' | 'text-cell-h2' | 'text-cell-h3'
78
79export function isTextBlock(block: DeepnoteBlock): block is TextBlock {
80 const textBlockTypes = [
81 'text-cell-p',
82 'text-cell-h1',
83 'text-cell-h2',
84 'text-cell-h3',
85 'text-cell-bullet',
86 'text-cell-todo',
87 'text-cell-callout',
88 ]
89
90 return textBlockTypes.includes(block.type.toLowerCase())
91}
92
93function escapeMarkdown(text: string): string {
94 return text.replace(/([\\`*_{}[\]()#+\-.!|>])/g, '\\$1')

Callers 2

createMarkdownFunction · 0.90
stripMarkdownFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected