dompurify 3.1.1 → 3.1.2
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 +3 -3
- package/dist/purify.cjs.js +9 -7
- package/dist/purify.cjs.js.map +1 -1
- package/dist/purify.es.mjs +9 -7
- package/dist/purify.es.mjs.map +1 -1
- package/dist/purify.js +9 -7
- 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.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @license DOMPurify 3.1.
|
|
1
|
+
/*! @license DOMPurify 3.1.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.2/LICENSE */
|
|
2
2
|
|
|
3
3
|
const {
|
|
4
4
|
entries,
|
|
@@ -282,7 +282,7 @@ function createDOMPurify() {
|
|
|
282
282
|
* Version label, exposed for easier checks
|
|
283
283
|
* if DOMPurify is up to date or not
|
|
284
284
|
*/
|
|
285
|
-
DOMPurify.version = '3.1.
|
|
285
|
+
DOMPurify.version = '3.1.2';
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
288
|
* Array of elements that DOMPurify removed during sanitation.
|
|
@@ -704,7 +704,7 @@ function createDOMPurify() {
|
|
|
704
704
|
CONFIG = cfg;
|
|
705
705
|
};
|
|
706
706
|
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
707
|
-
const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', '
|
|
707
|
+
const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);
|
|
708
708
|
|
|
709
709
|
// Certain elements are allowed in both SVG and HTML
|
|
710
710
|
// namespace. We need to specify them explicitly
|
|
@@ -1264,15 +1264,16 @@ function createDOMPurify() {
|
|
|
1264
1264
|
if (_sanitizeElements(shadowNode)) {
|
|
1265
1265
|
continue;
|
|
1266
1266
|
}
|
|
1267
|
+
const parentNode = getParentNode(shadowNode);
|
|
1267
1268
|
|
|
1268
1269
|
/* Set the nesting depth of an element */
|
|
1269
1270
|
if (shadowNode.nodeType === 1) {
|
|
1270
|
-
if (
|
|
1271
|
+
if (parentNode && parentNode.__depth) {
|
|
1271
1272
|
/*
|
|
1272
1273
|
We want the depth of the node in the original tree, which can
|
|
1273
1274
|
change when it's removed from its parent.
|
|
1274
1275
|
*/
|
|
1275
|
-
shadowNode.__depth = (shadowNode.__removalCount || 0) +
|
|
1276
|
+
shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;
|
|
1276
1277
|
} else {
|
|
1277
1278
|
shadowNode.__depth = 1;
|
|
1278
1279
|
}
|
|
@@ -1401,15 +1402,16 @@ function createDOMPurify() {
|
|
|
1401
1402
|
if (_sanitizeElements(currentNode)) {
|
|
1402
1403
|
continue;
|
|
1403
1404
|
}
|
|
1405
|
+
const parentNode = getParentNode(currentNode);
|
|
1404
1406
|
|
|
1405
1407
|
/* Set the nesting depth of an element */
|
|
1406
1408
|
if (currentNode.nodeType === 1) {
|
|
1407
|
-
if (
|
|
1409
|
+
if (parentNode && parentNode.__depth) {
|
|
1408
1410
|
/*
|
|
1409
1411
|
We want the depth of the node in the original tree, which can
|
|
1410
1412
|
change when it's removed from its parent.
|
|
1411
1413
|
*/
|
|
1412
|
-
currentNode.__depth = (currentNode.__removalCount || 0) +
|
|
1414
|
+
currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;
|
|
1413
1415
|
} else {
|
|
1414
1416
|
currentNode.__depth = 1;
|
|
1415
1417
|
}
|