From 5386e75a6885d8b09ea4955e7de42b4377a4c248 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 13 Sep 2023 19:45:12 +0800 Subject: [PATCH] :bug: fix /~https://github.com/Vanessa219/vditor/issues/1467 --- CHANGELOG.md | 1 + src/ts/markdown/markmapRender.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e454e958f..c4b711787 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ### v3.9.4 / 2023-09 +* [markmap 生产环境路径错误](/~https://github.com/Vanessa219/vditor/issues/1467) `修复缺陷` * [insertValue 后光标移动到插入的字符串之后](/~https://github.com/Vanessa219/vditor/issues/1464) `改进功能` * [preview.actions 为空不渲染工具栏](/~https://github.com/Vanessa219/vditor/issues/1453) `改进功能` * [MathJax 支持传入其他配置项](/~https://github.com/Vanessa219/vditor/issues/1453) `引入特性` diff --git a/src/ts/markdown/markmapRender.ts b/src/ts/markdown/markmapRender.ts index 55404bca9..221ad9a71 100644 --- a/src/ts/markdown/markmapRender.ts +++ b/src/ts/markdown/markmapRender.ts @@ -37,7 +37,7 @@ export const markmapRender = (element: HTMLElement, cdn = Constants.CDN, theme: if (markmapElements.length === 0) { return; } - addScript(`${cdn}/src/js/markmap/markmap.min.js`, "vditorMermaidScript").then(() => { + addScript(`${cdn}/dist/js/markmap/markmap.min.js`, "vditorMermaidScript").then(() => { markmapElements.forEach((item) => { const code = markmapRenderAdapter.getCode(item); if (item.getAttribute("data-processed") === "true" || code.trim() === "") { @@ -47,11 +47,11 @@ export const markmapRender = (element: HTMLElement, cdn = Constants.CDN, theme: render.className = "language-markmap" item.parentNode.appendChild(render) init(render,code) - + if(item.parentNode.childNodes[0].nodeName == "CODE"){ item.parentNode.removeChild(item.parentNode.childNodes[0]) } }); }); -}; \ No newline at end of file +};