mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	Allow kbd tags (#9245)
* Allow kbd tags Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add test Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
		
				
					committed by
					
						 techknowlogick
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							bdbdd6608f
						
					
				
				
					commit
					9a33adcdd3
				
			| @@ -47,6 +47,9 @@ func ReplaceSanitizer() { | ||||
|  | ||||
| 	// Allow keyword markup | ||||
| 	sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`^` + keywordClass + `$`)).OnElements("span") | ||||
|  | ||||
| 	// Allow <kbd> tags for keyboard shortcut styling | ||||
| 	sanitizer.policy.AllowElements("kbd") | ||||
| } | ||||
|  | ||||
| // Sanitize takes a string that contains a HTML fragment or document and applies policy whitelist. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user