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)