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.js
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
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
* Version label, exposed for easier checks
|
|
289
289
|
* if DOMPurify is up to date or not
|
|
290
290
|
*/
|
|
291
|
-
DOMPurify.version = '3.1.
|
|
291
|
+
DOMPurify.version = '3.1.2';
|
|
292
292
|
|
|
293
293
|
/**
|
|
294
294
|
* Array of elements that DOMPurify removed during sanitation.
|
|
@@ -710,7 +710,7 @@
|
|
|
710
710
|
CONFIG = cfg;
|
|
711
711
|
};
|
|
712
712
|
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
713
|
-
const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', '
|
|
713
|
+
const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);
|
|
714
714
|
|
|
715
715
|
// Certain elements are allowed in both SVG and HTML
|
|
716
716
|
// namespace. We need to specify them explicitly
|
|
@@ -1270,15 +1270,16 @@
|
|
|
1270
1270
|
if (_sanitizeElements(shadowNode)) {
|
|
1271
1271
|
continue;
|
|
1272
1272
|
}
|
|
1273
|
+
const parentNode = getParentNode(shadowNode);
|
|
1273
1274
|
|
|
1274
1275
|
/* Set the nesting depth of an element */
|
|
1275
1276
|
if (shadowNode.nodeType === 1) {
|
|
1276
|
-
if (
|
|
1277
|
+
if (parentNode && parentNode.__depth) {
|
|
1277
1278
|
/*
|
|
1278
1279
|
We want the depth of the node in the original tree, which can
|
|
1279
1280
|
change when it's removed from its parent.
|
|
1280
1281
|
*/
|
|
1281
|
-
shadowNode.__depth = (shadowNode.__removalCount || 0) +
|
|
1282
|
+
shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;
|
|
1282
1283
|
} else {
|
|
1283
1284
|
shadowNode.__depth = 1;
|
|
1284
1285
|
}
|
|
@@ -1407,15 +1408,16 @@
|
|
|
1407
1408
|
if (_sanitizeElements(currentNode)) {
|
|
1408
1409
|
continue;
|
|
1409
1410
|
}
|
|
1411
|
+
const parentNode = getParentNode(currentNode);
|
|
1410
1412
|
|
|
1411
1413
|
/* Set the nesting depth of an element */
|
|
1412
1414
|
if (currentNode.nodeType === 1) {
|
|
1413
|
-
if (
|
|
1415
|
+
if (parentNode && parentNode.__depth) {
|
|
1414
1416
|
/*
|
|
1415
1417
|
We want the depth of the node in the original tree, which can
|
|
1416
1418
|
change when it's removed from its parent.
|
|
1417
1419
|
*/
|
|
1418
|
-
currentNode.__depth = (currentNode.__removalCount || 0) +
|
|
1420
|
+
currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;
|
|
1419
1421
|
} else {
|
|
1420
1422
|
currentNode.__depth = 1;
|
|
1421
1423
|
}
|