dompurify 3.0.10 → 3.0.11
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 +10 -4
- package/dist/purify.cjs.js.map +1 -1
- package/dist/purify.es.mjs +10 -4
- package/dist/purify.es.mjs.map +1 -1
- package/dist/purify.js +10 -4
- 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.0.
|
|
1
|
+
/*! @license DOMPurify 3.0.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.11/LICENSE */
|
|
2
2
|
|
|
3
3
|
const {
|
|
4
4
|
entries,
|
|
@@ -215,7 +215,7 @@ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205
|
|
|
215
215
|
);
|
|
216
216
|
|
|
217
217
|
const DOCTYPE_NAME = seal(/^html$/i);
|
|
218
|
-
const CUSTOM_ELEMENT = seal(/^[a-z][
|
|
218
|
+
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
219
219
|
|
|
220
220
|
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
221
221
|
__proto__: null,
|
|
@@ -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.0.
|
|
285
|
+
DOMPurify.version = '3.0.11';
|
|
286
286
|
|
|
287
287
|
/**
|
|
288
288
|
* Array of elements that DOMPurify removed during sanitation.
|
|
@@ -909,7 +909,7 @@ function createDOMPurify() {
|
|
|
909
909
|
const _createNodeIterator = function _createNodeIterator(root) {
|
|
910
910
|
return createNodeIterator.call(root.ownerDocument || root, root,
|
|
911
911
|
// eslint-disable-next-line no-bitwise
|
|
912
|
-
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
912
|
+
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
913
913
|
};
|
|
914
914
|
|
|
915
915
|
/**
|
|
@@ -986,6 +986,12 @@ function createDOMPurify() {
|
|
|
986
986
|
return true;
|
|
987
987
|
}
|
|
988
988
|
|
|
989
|
+
/* Remove any ocurrence of processing instructions */
|
|
990
|
+
if (currentNode.nodeType === 7) {
|
|
991
|
+
_forceRemove(currentNode);
|
|
992
|
+
return true;
|
|
993
|
+
}
|
|
994
|
+
|
|
989
995
|
/* Remove element if anything forbids its presence */
|
|
990
996
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
991
997
|
/* Check if we have a custom element to handle */
|