update utils

This commit is contained in:
Chen, Tai-Lin committed 2024-03-04 23:34:06 +08:00
1 parent 817cf8c40e
commit c324bfcfee
4 files changed
+13 -11

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: string) {
const html = marked.parse(markdown)
return DOMPurify.sanitize(html)
}