mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
use numbers and not http.Status___ enum
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
package misc
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
@@ -65,20 +64,20 @@ func Markdown(ctx *context.APIContext, form api.MarkdownOption) {
|
||||
if form.Wiki {
|
||||
_, err := ctx.Write([]byte(markdown.RenderWiki(md, urlPrefix, meta)))
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "", err)
|
||||
ctx.Error(500, "", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
_, err := ctx.Write(markdown.Render(md, urlPrefix, meta))
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "", err)
|
||||
ctx.Error(500, "", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
default:
|
||||
_, err := ctx.Write(markdown.RenderRaw([]byte(form.Text), "", false))
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "", err)
|
||||
ctx.Error(500, "", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -112,7 +111,7 @@ func MarkdownRaw(ctx *context.APIContext) {
|
||||
}
|
||||
_, err = ctx.Write(markdown.RenderRaw(body, "", false))
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "", err)
|
||||
ctx.Error(500, "", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user