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:
parent
bdbdd6608f
commit
9a33adcdd3
2 changed files with 6 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue