feat: display markdown to html

This commit is contained in:
Lin, Hung-Shin committed 2023-11-26 23:16:13 +08:00
1 parent ebd81f7cb4
commit abaacf7ee7
5 files changed
+72 -18

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
import { marked } from 'marked'
import DOMPurify from 'dompurify'
export default function markdown2HTML(markdown) {
const html = marked.parse(markdown)
return DOMPurify.sanitize(html)
}