mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: display markdown to html
This commit is contained in:
1 parent
ebd81f7cb4
commit
abaacf7ee7
5 files changed
+72
-18
No files matched your search
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user