aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-04-06 20:07:08 +0800
committerGitHub <noreply@github.com>2024-04-06 20:07:08 +0800
commit7396172a02a9ea8d80f9763469fd65a5a12ff3f7 (patch)
tree542c878fb484a660504d8588c2bcff6cd1c3ff2a /modules
parent9c1f4dae2ee85b748250ba7b161d70bd529088d3 (diff)
downloadgitea-7396172a02a9ea8d80f9763469fd65a5a12ff3f7.tar.gz
gitea-7396172a02a9ea8d80f9763469fd65a5a12ff3f7.zip
Fix code block style for code preview (#30298)
Fix #30292 To avoid unnecessary style overriding, use "div" instead of "code"
Diffstat (limited to 'modules')
-rw-r--r--modules/markup/sanitizer.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/markup/sanitizer.go b/modules/markup/sanitizer.go
index 77fbdf4520..570a1da248 100644
--- a/modules/markup/sanitizer.go
+++ b/modules/markup/sanitizer.go
@@ -65,7 +65,7 @@ func createDefaultPolicy() *bluemonday.Policy {
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^lines-num$`)).OnElements("td")
policy.AllowAttrs("data-line-number").OnElements("span")
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^lines-code chroma$`)).OnElements("td")
- policy.AllowAttrs("class").Matching(regexp.MustCompile(`^code-inner$`)).OnElements("code")
+ policy.AllowAttrs("class").Matching(regexp.MustCompile(`^code-inner$`)).OnElements("div")
// For code preview (unicode escape)
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^file-view( unicode-escaped)?$`)).OnElements("table")