diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-04-06 20:07:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-06 20:07:08 +0800 |
commit | 7396172a02a9ea8d80f9763469fd65a5a12ff3f7 (patch) | |
tree | 542c878fb484a660504d8588c2bcff6cd1c3ff2a /modules | |
parent | 9c1f4dae2ee85b748250ba7b161d70bd529088d3 (diff) | |
download | gitea-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.go | 2 |
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") |