From 5a74e3605092afa8d9887901fffe6435de01ee0e Mon Sep 17 00:00:00 2001 From: purocean Date: Mon, 7 Mar 2022 19:09:21 +0800 Subject: [PATCH] fix: lint --- src/renderer/components/Preview.vue | 2 +- src/renderer/plugins/copy-content.tsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/Preview.vue b/src/renderer/components/Preview.vue index 9860b226..f4033651 100644 --- a/src/renderer/components/Preview.vue +++ b/src/renderer/components/Preview.vue @@ -177,7 +177,7 @@ export default defineComponent({ } const startTime = performance.now() - renderEnv = { source: content, file: currentFile.value, renderCount: renderCount++ } + renderEnv = { tokens: [], source: content, file: currentFile.value, renderCount: renderCount++ } try { renderContent.value = markdown.render(content, renderEnv) } catch (error: any) { diff --git a/src/renderer/plugins/copy-content.tsx b/src/renderer/plugins/copy-content.tsx index 0f4d2cb2..7e06412e 100644 --- a/src/renderer/plugins/copy-content.tsx +++ b/src/renderer/plugins/copy-content.tsx @@ -54,12 +54,11 @@ export default { } const processImg = async (tokens: Token[]) => { - for (let token of tokens) { + for (const token of tokens) { if (token.children) { await processImg(token.children) } - if (token.tag === 'img' && token.attrGet(ctx.constant.DOM_ATTR_NAME.LOCAL_IMAGE)) { const srcAttr = token.attrGet('src') const originSrc = token.attrGet(ctx.constant.DOM_ATTR_NAME.ORIGIN_SRC)