mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-21 22:41:05 +08:00
feat: render markdown in posts and comments
This commit is contained in:
11
open-isle-cli/src/utils/markdown.js
Normal file
11
open-isle-cli/src/utils/markdown.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import MarkdownIt from 'markdown-it'
|
||||
|
||||
const md = new MarkdownIt({
|
||||
html: false,
|
||||
linkify: true,
|
||||
breaks: true
|
||||
})
|
||||
|
||||
export function renderMarkdown(text) {
|
||||
return md.render(text || '')
|
||||
}
|
||||
Reference in New Issue
Block a user