diff --git a/modules/web/route.go b/modules/web/route.go index 77c411a97b..787521dfb0 100644 --- a/modules/web/route.go +++ b/modules/web/route.go @@ -9,6 +9,7 @@ import ( "reflect" "strings" + "code.gitea.io/gitea/modules/htmlutil" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/web/middleware" @@ -214,7 +215,9 @@ func (r *Router) normalizeRequestPath(resp http.ResponseWriter, req *http.Reques normalizedPath = "/" } else if !strings.HasPrefix(normalizedPath+"/", "/v2/") { // do not respond to other requests, to simulate a real sub-path environment - http.Error(resp, "404 page not found, sub-path is: "+setting.AppSubURL, http.StatusNotFound) + resp.Header().Add("Content-Type", "text/html; charset=utf-8") + resp.WriteHeader(http.StatusNotFound) + _, _ = resp.Write([]byte(htmlutil.HTMLFormat(`404 page not found, sub-path is: %s`, setting.AppSubURL, setting.AppSubURL))) return } normalized = true diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 8da7412ade..57d2d89c5a 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2590,7 +2590,6 @@ diff.generated = generated diff.vendored = vendored diff.comment.add_line_comment = Add line comment diff.comment.placeholder = Leave a comment -diff.comment.markdown_info = Styling with markdown is supported. diff.comment.add_single_comment = Add single comment diff.comment.add_review_comment = Add comment diff.comment.start_review = Start review diff --git a/routers/web/web.go b/routers/web/web.go index 5ed046a983..e89d069449 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -485,6 +485,8 @@ func registerRoutes(m *web.Router) { m.Methods("GET, HEAD", "/*", public.FileHandlerFunc()) }, optionsCorsHandler()) + m.Post("/-/markup", reqSignIn, web.Bind(structs.MarkupOption{}), misc.Markup) + m.Group("/explore", func() { m.Get("", func(ctx *context.Context) { ctx.Redirect(setting.AppSubURL + "/explore/repos") diff --git a/templates/devtest/devtest-footer.tmpl b/templates/devtest/devtest-footer.tmpl index 1c755508a5..a1b3b86e5c 100644 --- a/templates/devtest/devtest-footer.tmpl +++ b/templates/devtest/devtest-footer.tmpl @@ -1,3 +1,3 @@ {{/* TODO: the devtest.js is isolated from index.js, so no module is shared and many index.js functions do not work in devtest.ts */}} -{{template "base/footer" dict}} +{{template "base/footer" ctx.RootData}} diff --git a/templates/devtest/devtest-header.tmpl b/templates/devtest/devtest-header.tmpl index a5910b96e6..ee08545640 100644 --- a/templates/devtest/devtest-header.tmpl +++ b/templates/devtest/devtest-header.tmpl @@ -1,2 +1,2 @@ -{{template "base/head" dict}} +{{template "base/head" ctx.RootData}} diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl index 303421fe13..5b40268761 100644 --- a/templates/devtest/gitea-ui.tmpl +++ b/templates/devtest/gitea-ui.tmpl @@ -183,8 +183,7 @@