dompurify 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/purify.cjs.d.ts +6 -2
- package/dist/purify.cjs.js +8 -2
- package/dist/purify.cjs.js.map +1 -1
- package/dist/purify.es.d.mts +6 -2
- package/dist/purify.es.mjs +8 -2
- package/dist/purify.es.mjs.map +1 -1
- package/dist/purify.js +8 -2
- package/dist/purify.js.map +1 -1
- package/dist/purify.min.js +2 -2
- package/dist/purify.min.js.map +1 -1
- package/package.json +1 -1
package/dist/purify.es.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.3.
|
|
1
|
+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
2
2
|
|
|
3
|
-
import { TrustedTypePolicy, TrustedHTML, TrustedTypesWindow } from 'trusted-types/lib';
|
|
3
|
+
import { TrustedTypePolicy, TrustedHTML, TrustedTypesWindow } from 'trusted-types/lib/index.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Configuration to control DOMPurify behavior.
|
|
@@ -94,6 +94,10 @@ interface Config {
|
|
|
94
94
|
* Add child elements to be removed when their parent is removed.
|
|
95
95
|
*/
|
|
96
96
|
FORBID_CONTENTS?: string[] | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Extend the existing or default array of forbidden content elements.
|
|
99
|
+
*/
|
|
100
|
+
ADD_FORBID_CONTENTS?: string[] | undefined;
|
|
97
101
|
/**
|
|
98
102
|
* Add elements to block-list.
|
|
99
103
|
*/
|
package/dist/purify.es.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.3.
|
|
1
|
+
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
2
2
|
|
|
3
3
|
const {
|
|
4
4
|
entries,
|
|
@@ -305,7 +305,7 @@ const _createHooksMap = function _createHooksMap() {
|
|
|
305
305
|
function createDOMPurify() {
|
|
306
306
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
307
307
|
const DOMPurify = root => createDOMPurify(root);
|
|
308
|
-
DOMPurify.version = '3.3.
|
|
308
|
+
DOMPurify.version = '3.3.1';
|
|
309
309
|
DOMPurify.removed = [];
|
|
310
310
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
311
311
|
// Not running in a browser, provide a factory function
|
|
@@ -651,6 +651,12 @@ function createDOMPurify() {
|
|
|
651
651
|
}
|
|
652
652
|
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
653
653
|
}
|
|
654
|
+
if (cfg.ADD_FORBID_CONTENTS) {
|
|
655
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
656
|
+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
657
|
+
}
|
|
658
|
+
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
|
|
659
|
+
}
|
|
654
660
|
/* Add #text in case KEEP_CONTENT is set to true */
|
|
655
661
|
if (KEEP_CONTENT) {
|
|
656
662
|
ALLOWED_TAGS['#text'] = true;
|