mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-28 13:20:20 +08: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