From 09f203a149e6decb42d4de457e5b1356104f8752 Mon Sep 17 00:00:00 2001 From: purocean Date: Thu, 4 Nov 2021 19:18:20 +0800 Subject: [PATCH] =?UTF-8?q?upd:=20=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/plugins/markdown-front-matter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/plugins/markdown-front-matter.ts b/src/renderer/plugins/markdown-front-matter.ts index d8f82fbd..6b1f405d 100644 --- a/src/renderer/plugins/markdown-front-matter.ts +++ b/src/renderer/plugins/markdown-front-matter.ts @@ -18,14 +18,14 @@ export default { if (fm.attributes && typeof fm.attributes === 'object') { attributes = fm.attributes } - - return render.call(md, src, { ...env, bodyBegin, attributes }) } catch (error) { console.error(error) } logger.debug('render', bodyBegin, attributes) - return render.call(md, src, { ...env, bodyBegin, attributes }) + + Object.assign(env, { bodyBegin, attributes }) + return render.call(md, src, env) } const firstRule = (md.block.ruler as any).__rules__[0]