mirror of
https://github.com/lynchmarkHQ/lynchmark.com.git
synced 2026-10-17 09:17:53 +00:00
8 lines
305 B
JavaScript
8 lines
305 B
JavaScript
const parseMarkdown = async s => {
|
|
const [{ marked: m }, { default: p }] = await Promise.all([
|
|
import('https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js'),
|
|
import('https://cdn.jsdelivr.net/npm/dompurify/dist/purify.es.js')
|
|
])
|
|
return p.sanitize(m.parse(s))
|
|
}
|
|
export default parseMarkdown; |