mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-19 16:30:15 +00:00
#12, use go-gogs-client
This commit is contained in:
parent
437dd5272f
commit
52d66ba6c8
11 changed files with 48 additions and 74 deletions
|
@ -13,12 +13,10 @@ import (
|
|||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const DOC_URL = "http://gogs.io/docs"
|
||||
|
||||
// Render an arbitrary Markdown document.
|
||||
func Markdown(ctx *middleware.Context, form apiv1.MarkdownForm) {
|
||||
if ctx.HasApiError() {
|
||||
ctx.JSON(422, base.ApiJsonErr{ctx.GetErrMsg(), DOC_URL})
|
||||
ctx.JSON(422, base.ApiJsonErr{ctx.GetErrMsg(), base.DOC_URL})
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -35,7 +33,7 @@ func Markdown(ctx *middleware.Context, form apiv1.MarkdownForm) {
|
|||
func MarkdownRaw(ctx *middleware.Context) {
|
||||
body, err := ctx.Req.Body().Bytes()
|
||||
if err != nil {
|
||||
ctx.JSON(422, base.ApiJsonErr{err.Error(), DOC_URL})
|
||||
ctx.JSON(422, base.ApiJsonErr{err.Error(), base.DOC_URL})
|
||||
return
|
||||
}
|
||||
ctx.Write(base.RenderRawMarkdown(body, ""))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue