import MarkdownIt from 'markdown-it' import hljs from 'highlight.js' const md = new MarkdownIt({ html: false, linkify: false, breaks: true, typographer: true, quotes: '“”‘’', highlight: (str: any, lang: any): string => { if (lang && hljs.getLanguage(lang)) { try { return `
${hljs.highlight(str, { language: lang, ignoreIllegals: true }).value}
`
} catch (e) {
console.error(e)
}
}
return '' + md.utils.escapeHtml(str) + ''
},
})
export default md