mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-04 19:24:28 +01:00
allow data-line-number on markup sanitizer
This commit is contained in:
parent
c1ff830c11
commit
58da585b7e
@ -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...)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user