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

@ -890,3 +890,14 @@ func checkbox(ctx echo.Context) error {
return plainText(ctx, 200, "ok")
}
func preview(ctx echo.Context) error {
content := ctx.FormValue("content")
previewStr, err := render.MarkdownString(content)
if err != nil {
return errorRes(500, "Error rendering markdown", err)
}
return plainText(ctx, 200, previewStr)
}