From cea9bff7a439d8ea00647c9a7c893efb254237dd Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 23 Jul 2019 10:13:58 +0800 Subject: [PATCH] cache --- public/react/src/common/TextUtil.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index c711143d2..bd524c4a9 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -6,6 +6,9 @@ export function isImageExtension(fileName) { export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html + try { + + var markdwonParser = window.editormd.markdownToHTML("md_div", { markdown: oldContent, emoji: true, @@ -15,6 +18,11 @@ export function markdownToHTML(oldContent, selector) { flowChart: true, // 默认不解析 sequenceDiagram: true // 默认不解析 }); + + } catch(e) { + console.error(e) + } + const content = window.$('#md_div').html() if (selector) { window.$(selector).html(content)