mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-08 07:49:50 +02:00
allow data-line-number on markup sanitizer
This commit is contained in:
1 file changed
+3
@@ -30,6 +30,9 @@ func (st *Sanitizer) createDefaultPolicy() *bluemonday.Policy {
|
|||||||
// Chroma always uses 1-2 letters for style names, we could tolerate it at the moment
|
// Chroma always uses 1-2 letters for style names, we could tolerate it at the moment
|
||||||
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^\w{0,2}$`)).OnElements("span")
|
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^\w{0,2}$`)).OnElements("span")
|
||||||
|
|
||||||
|
// Line numbers on codepreview
|
||||||
|
policy.AllowAttrs("data-line-number").OnElements("span")
|
||||||
|
|
||||||
// Custom URL-Schemes
|
// Custom URL-Schemes
|
||||||
if len(setting.Markdown.CustomURLSchemes) > 0 {
|
if len(setting.Markdown.CustomURLSchemes) > 0 {
|
||||||
policy.AllowURLSchemes(setting.Markdown.CustomURLSchemes...)
|
policy.AllowURLSchemes(setting.Markdown.CustomURLSchemes...)
|
||||||
|
|||||||
Reference in new issue
Block a user