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

Function createMarkdownForImageBlock

packages/blocks/src/blocks/image-blocks.ts:24–30  ·  view source on GitHub ↗
(block: ImageBlock)

Source from the content-addressed store, hash-verified

22}
23
24export function createMarkdownForImageBlock(block: ImageBlock): string {
25 const src = escapeHtmlAttribute(block.metadata?.deepnote_img_src ?? '')
26 const width = sanitizeWidth(block.metadata?.deepnote_img_width ?? '')
27 const alignment = sanitizeAlignment(block.metadata?.deepnote_img_alignment ?? '')
28
29 return `<img src="${src}" width="${width}" align="${alignment}" />`
30}
31
32export function isImageBlock(block: DeepnoteBlock): block is ImageBlock {
33 return block.type === 'image'

Callers 1

createMarkdownFunction · 0.90

Calls 3

escapeHtmlAttributeFunction · 0.85
sanitizeWidthFunction · 0.85
sanitizeAlignmentFunction · 0.85

Tested by

no test coverage detected