Check for attachment: in markdown cell renderer (#181462)

actually check if its json attachment style...
This commit is contained in:
Michael Lively 2023-05-03 16:51:22 -07:00 committed by GitHub
parent 03d10051e1
commit f198ea9177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ export async function activate(ctx: RendererContext<void>) {
const token = tokens[idx];
const src = token.attrGet('src');
const attachments: Record<string, Record<string, string>> | 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