From 9ac536a904b1ca8362d7fd59fc204662ff52139e Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 3 Jan 2025 04:01:05 +0800 Subject: [PATCH] Fix "stop time tracking button" on navbar (#33084) Fix #33083 By the way (something I was working on): 1. relax color/background-color for more markup elements 2. fix a command line sentence error --- cmd/migrate.go | 2 +- modules/markup/sanitizer_default.go | 2 +- templates/base/head_navbar.tmpl | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/migrate.go b/cmd/migrate.go index 4e4dd45af3..459805a76d 100644 --- a/cmd/migrate.go +++ b/cmd/migrate.go @@ -18,7 +18,7 @@ import ( var CmdMigrate = &cli.Command{ Name: "migrate", Usage: "Migrate the database", - Description: "This is a command for migrating the database, so that you can run gitea admin create-user before starting the server.", + Description: `This is a command for migrating the database, so that you can run "gitea admin create user" before starting the server.`, Action: runMigrate, } diff --git a/modules/markup/sanitizer_default.go b/modules/markup/sanitizer_default.go index 5eeafe940a..14161eb533 100644 --- a/modules/markup/sanitizer_default.go +++ b/modules/markup/sanitizer_default.go @@ -48,7 +48,7 @@ func (st *Sanitizer) createDefaultPolicy() *bluemonday.Policy { policy.AllowAttrs("class").Matching(regexp.MustCompile(`^(unchecked|checked|indeterminate)$`)).OnElements("li") // Allow 'color' and 'background-color' properties for the style attribute on text elements. - policy.AllowStyles("color", "background-color").OnElements("span", "p") + policy.AllowStyles("color", "background-color").OnElements("div", "span", "p", "tr", "th", "td") policy.AllowAttrs("src", "autoplay", "controls").OnElements("video") diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index ed7a8d6f24..bf0e7e632b 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -192,7 +192,7 @@ {{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}}
-
+ {{.CsrfTokenHtml}}
-
+ {{.CsrfTokenHtml}}