Markdown preview (#224)

This commit is contained in:
Thomas Miceli
2024-02-24 18:09:23 +01:00
parent 2bf0e9b7ce
commit fc9a75ce8f
9 changed files with 69 additions and 3 deletions

View File

@ -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(