dompurify 2.5.1 → 2.5.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 +2 -2
- package/dist/purify.cjs.js +9 -7
- package/dist/purify.cjs.js.map +1 -1
- package/dist/purify.es.js +9 -7
- package/dist/purify.es.js.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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @license DOMPurify 2.5.
|
|
1
|
+
/*! @license DOMPurify 2.5.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.2/LICENSE */
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) {
|
|
4
4
|
"@babel/helpers - typeof";
|
|
@@ -281,7 +281,7 @@ function createDOMPurify() {
|
|
|
281
281
|
* Version label, exposed for easier checks
|
|
282
282
|
* if DOMPurify is up to date or not
|
|
283
283
|
*/
|
|
284
|
-
DOMPurify.version = '2.5.
|
|
284
|
+
DOMPurify.version = '2.5.2';
|
|
285
285
|
|
|
286
286
|
/**
|
|
287
287
|
* Array of elements that DOMPurify removed during sanitation.
|
|
@@ -671,7 +671,7 @@ function createDOMPurify() {
|
|
|
671
671
|
CONFIG = cfg;
|
|
672
672
|
};
|
|
673
673
|
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
674
|
-
var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', '
|
|
674
|
+
var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);
|
|
675
675
|
|
|
676
676
|
// Certain elements are allowed in both SVG and HTML
|
|
677
677
|
// namespace. We need to specify them explicitly
|
|
@@ -1242,15 +1242,16 @@ function createDOMPurify() {
|
|
|
1242
1242
|
if (_sanitizeElements(shadowNode)) {
|
|
1243
1243
|
continue;
|
|
1244
1244
|
}
|
|
1245
|
+
var parentNode = getParentNode(shadowNode);
|
|
1245
1246
|
|
|
1246
1247
|
/* Set the nesting depth of an element */
|
|
1247
1248
|
if (shadowNode.nodeType === 1) {
|
|
1248
|
-
if (
|
|
1249
|
+
if (parentNode && parentNode.__depth) {
|
|
1249
1250
|
/*
|
|
1250
1251
|
We want the depth of the node in the original tree, which can
|
|
1251
1252
|
change when it's removed from its parent.
|
|
1252
1253
|
*/
|
|
1253
|
-
shadowNode.__depth = (shadowNode.__removalCount || 0) +
|
|
1254
|
+
shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;
|
|
1254
1255
|
} else {
|
|
1255
1256
|
shadowNode.__depth = 1;
|
|
1256
1257
|
}
|
|
@@ -1393,15 +1394,16 @@ function createDOMPurify() {
|
|
|
1393
1394
|
if (_sanitizeElements(currentNode)) {
|
|
1394
1395
|
continue;
|
|
1395
1396
|
}
|
|
1397
|
+
var parentNode = getParentNode(currentNode);
|
|
1396
1398
|
|
|
1397
1399
|
/* Set the nesting depth of an element */
|
|
1398
1400
|
if (currentNode.nodeType === 1) {
|
|
1399
|
-
if (
|
|
1401
|
+
if (parentNode && parentNode.__depth) {
|
|
1400
1402
|
/*
|
|
1401
1403
|
We want the depth of the node in the original tree, which can
|
|
1402
1404
|
change when it's removed from its parent.
|
|
1403
1405
|
*/
|
|
1404
|
-
currentNode.__depth = (currentNode.__removalCount || 0) +
|
|
1406
|
+
currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;
|
|
1405
1407
|
} else {
|
|
1406
1408
|
currentNode.__depth = 1;
|
|
1407
1409
|
}
|