mirror of
https://github.com/go-gitea/gitea
synced 2025-07-04 09:37:19 +00: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
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