We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb8aea4 commit 948dec3Copy full SHA for 948dec3
modules/markup/sanitizer.go
@@ -38,7 +38,7 @@ func NewSanitizer() {
38
func ReplaceSanitizer() {
39
sanitizer.policy = bluemonday.UGCPolicy()
40
// We only want to allow HighlightJS specific classes for code blocks
41
- sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-\w+$`)).OnElements("code")
+ sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-[\w-]+$`)).OnElements("code")
42
43
// Checkboxes
44
sanitizer.policy.AllowAttrs("type").Matching(regexp.MustCompile(`^checkbox$`)).OnElements("input")
0 commit comments