1
1
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:
6543
2019-12-19 23:55:23 +01:00
parent e2fc0a0dfd
commit b1ff386e24
14 changed files with 82 additions and 96 deletions

View File

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