Переглянути джерело

Allow hyphen in language name (#9873)

tags/v1.10.5
zeripath 4 роки тому
джерело
коміт
948dec3d75
Аккаунт користувача з таким Email не знайдено
1 змінених файлів з 1 додано та 1 видалено
  1. 1
    1
      modules/markup/sanitizer.go

+ 1
- 1
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")

Завантаження…
Відмінити
Зберегти