mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-01-23 02:35:23 +00:00
refactor: use given HTML config for DOMPurify
This commit is contained in:
parent
f6893d338b
commit
ad55131831
1 changed files with 3 additions and 4 deletions
|
|
@ -812,12 +812,11 @@ jQuery.PrivateBin = (function($) {
|
|||
|
||||
if (containsHtml) {
|
||||
// only allow tags/attributes we actually use in translations
|
||||
output = DOMPurify.sanitize(
|
||||
output, {
|
||||
const sanitizeConfig = Object.assign({}, purifyHtmlConfig, {
|
||||
ALLOWED_TAGS: ['a', 'i', 'span', 'kbd'],
|
||||
ALLOWED_ATTR: ['href', 'id']
|
||||
}
|
||||
);
|
||||
});
|
||||
output = DOMPurify.sanitize(output, sanitizeConfig);
|
||||
}
|
||||
|
||||
// if $element is given, insert translation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue