mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
formatting
This commit is contained in:
@@ -22,16 +22,12 @@ export async function activate(ctx: RendererContext<void>) {
|
||||
md.renderer.rules.image = (tokens: MarkdownItToken[], idx: number, options, env, self) => {
|
||||
const token = tokens[idx];
|
||||
const src = token.attrGet('src');
|
||||
// if (env.outputItem.metadata?.custom?.attachments) {
|
||||
// const attachments: Record<string, Record<string, string>> = (env.outputItem.metadata as any).custom.attachments;
|
||||
const attachments: Record<string, Record<string, string>> = env.outputItem.metadata?.custom?.attachments;
|
||||
if (attachments && src) {
|
||||
const [attachmentKey, attachmentVal] = Object.entries(attachments[src.replace('attachment:', '')])[0];
|
||||
const b64Markdown = 'data:' + attachmentKey + ';base64,' + attachmentVal;
|
||||
token.attrSet('src', b64Markdown);
|
||||
}
|
||||
// }
|
||||
//
|
||||
|
||||
if (original) {
|
||||
return original(tokens, idx, options, env, self);
|
||||
|
||||
Reference in New Issue
Block a user