|
|
|
@ -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)
|
|
|
|
|