diff options
author | zeripath <art27@cantab.net> | 2020-01-19 21:36:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-19 21:36:00 +0000 |
commit | 948dec3d7519dd5b93db9a0027477da9f5331fb3 (patch) | |
tree | 0e3a1f86f93a25e583c15f3a87ac369c04893628 /modules/markup/sanitizer.go | |
parent | fb8aea4eeb1e17badd5a325956d2ff1c37bd3a6e (diff) | |
download | gitea-948dec3d7519dd5b93db9a0027477da9f5331fb3.tar.gz gitea-948dec3d7519dd5b93db9a0027477da9f5331fb3.zip |
Allow hyphen in language name (#9873)
Diffstat (limited to 'modules/markup/sanitizer.go')
-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 d135d41966..5158e67c2a 100644 --- a/modules/markup/sanitizer.go +++ b/modules/markup/sanitizer.go @@ -38,7 +38,7 @@ func NewSanitizer() { func ReplaceSanitizer() { sanitizer.policy = bluemonday.UGCPolicy() // We only want to allow HighlightJS specific classes for code blocks - sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-\w+$`)).OnElements("code") + sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^language-[\w-]+$`)).OnElements("code") // Checkboxes sanitizer.policy.AllowAttrs("type").Matching(regexp.MustCompile(`^checkbox$`)).OnElements("input") |