From 9461585d9e76fc9ba64856ee05471dbba78b0460 Mon Sep 17 00:00:00 2001 From: YangFong Date: Wed, 21 Feb 2024 14:36:27 +0800 Subject: [PATCH] fix: code block rendering exception (#273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 无名代码块渲染导致渲染失败 fix #272 --- src/assets/scripts/renderers/wx-renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/scripts/renderers/wx-renderer.js b/src/assets/scripts/renderers/wx-renderer.js index 43f582d..e1f4539 100644 --- a/src/assets/scripts/renderers/wx-renderer.js +++ b/src/assets/scripts/renderers/wx-renderer.js @@ -126,7 +126,7 @@ class WxRenderer { text = text.replace(//g, `

`); return `

${text}
`; }; - renderer.code = (text, lang) => { + renderer.code = (text, lang = "") => { if (lang.startsWith("mermaid")) { setTimeout(() => { window.mermaid?.run();