Skip to content

Commit 58da585

Browse files
committed
allow data-line-number on markup sanitizer
1 parent c1ff830 commit 58da585

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/markup/sanitizer_default.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ func (st *Sanitizer) createDefaultPolicy() *bluemonday.Policy {
3030
// Chroma always uses 1-2 letters for style names, we could tolerate it at the moment
3131
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^\w{0,2}$`)).OnElements("span")
3232

33+
// Line numbers on codepreview
34+
policy.AllowAttrs("data-line-number").OnElements("span")
35+
3336
// Custom URL-Schemes
3437
if len(setting.Markdown.CustomURLSchemes) > 0 {
3538
policy.AllowURLSchemes(setting.Markdown.CustomURLSchemes...)

0 commit comments

Comments
 (0)