(block: DeepnoteBlock)
| 77 | export type HeadingTextBlockType = 'text-cell-h1' | 'text-cell-h2' | 'text-cell-h3' |
| 78 | |
| 79 | export 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 | |
| 93 | function escapeMarkdown(text: string): string { |
| 94 | return text.replace(/([\\`*_{}[\]()#+\-.!|>])/g, '\\$1') |
no outgoing calls
no test coverage detected