From f198ea9177d5590467599e7d822719e1da29f16d Mon Sep 17 00:00:00 2001 From: Michael Lively Date: Wed, 3 May 2023 16:51:22 -0700 Subject: [PATCH] Check for `attachment:` in markdown cell renderer (#181462) actually check if its json attachment style... --- extensions/ipynb/notebook-src/cellAttachmentRenderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/ipynb/notebook-src/cellAttachmentRenderer.ts b/extensions/ipynb/notebook-src/cellAttachmentRenderer.ts index 87e14d611da..02166f7d7cd 100644 --- a/extensions/ipynb/notebook-src/cellAttachmentRenderer.ts +++ b/extensions/ipynb/notebook-src/cellAttachmentRenderer.ts @@ -23,7 +23,7 @@ export async function activate(ctx: RendererContext) { const token = tokens[idx]; const src = token.attrGet('src'); const attachments: Record> | undefined = env.outputItem.metadata?.attachments; - if (attachments && src) { + if (attachments && src && src.startsWith('attachment:')) { const imageAttachment = attachments[tryDecodeURIComponent(src.replace('attachment:', ''))]; if (imageAttachment) { // objEntries will always be length 1, with objEntries[0] holding [0]=mime,[1]=b64