mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-09 17:38:04 +02:00
Markdown preview (#224)
This commit is contained in:
@ -41,6 +41,12 @@ func MarkdownFile(file *git.File) (RenderedFile, error) {
|
||||
Type: "Markdown",
|
||||
}, err
|
||||
}
|
||||
func MarkdownString(content string) (string, error) {
|
||||
var buf bytes.Buffer
|
||||
err := newMarkdown().Convert([]byte(content), &buf)
|
||||
|
||||
return buf.String(), err
|
||||
}
|
||||
|
||||
func newMarkdown() goldmark.Markdown {
|
||||
return goldmark.New(
|
||||
|
Reference in New Issue
Block a user