mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Allow hyphen in language name (#9873)
This commit is contained in:
		| @@ -38,7 +38,7 @@ func NewSanitizer() { | |||||||
| func ReplaceSanitizer() { | func ReplaceSanitizer() { | ||||||
| 	sanitizer.policy = bluemonday.UGCPolicy() | 	sanitizer.policy = bluemonday.UGCPolicy() | ||||||
| 	// We only want to allow HighlightJS specific classes for code blocks | 	// 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 | 	// Checkboxes | ||||||
| 	sanitizer.policy.AllowAttrs("type").Matching(regexp.MustCompile(`^checkbox$`)).OnElements("input") | 	sanitizer.policy.AllowAttrs("type").Matching(regexp.MustCompile(`^checkbox$`)).OnElements("input") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user