dompurify 3.0.9 → 3.0.10

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/dist/purify.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 3.0.9 | (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.9/LICENSE */
1
+ /*! @license DOMPurify 3.0.10 | (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.10/LICENSE */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -221,6 +221,7 @@
221
221
  );
222
222
 
223
223
  const DOCTYPE_NAME = seal(/^html$/i);
224
+ const CUSTOM_ELEMENT = seal(/^[a-z][a-z\d]*(-[a-z\d]+)+$/i);
224
225
 
225
226
  var EXPRESSIONS = /*#__PURE__*/Object.freeze({
226
227
  __proto__: null,
@@ -232,7 +233,8 @@
232
233
  IS_ALLOWED_URI: IS_ALLOWED_URI,
233
234
  IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
234
235
  ATTR_WHITESPACE: ATTR_WHITESPACE,
235
- DOCTYPE_NAME: DOCTYPE_NAME
236
+ DOCTYPE_NAME: DOCTYPE_NAME,
237
+ CUSTOM_ELEMENT: CUSTOM_ELEMENT
236
238
  });
237
239
 
238
240
  const getGlobal = function getGlobal() {
@@ -286,7 +288,7 @@
286
288
  * Version label, exposed for easier checks
287
289
  * if DOMPurify is up to date or not
288
290
  */
289
- DOMPurify.version = '3.0.9';
291
+ DOMPurify.version = '3.0.10';
290
292
 
291
293
  /**
292
294
  * Array of elements that DOMPurify removed during sanitation.
@@ -357,7 +359,8 @@
357
359
  DATA_ATTR,
358
360
  ARIA_ATTR,
359
361
  IS_SCRIPT_OR_DATA,
360
- ATTR_WHITESPACE
362
+ ATTR_WHITESPACE,
363
+ CUSTOM_ELEMENT
361
364
  } = EXPRESSIONS;
362
365
  let {
363
366
  IS_ALLOWED_URI: IS_ALLOWED_URI$1
@@ -912,7 +915,7 @@
912
915
  const _createNodeIterator = function _createNodeIterator(root) {
913
916
  return createNodeIterator.call(root.ownerDocument || root, root,
914
917
  // eslint-disable-next-line no-bitwise
915
- NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null);
918
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
916
919
  };
917
920
 
918
921
  /**
@@ -1094,7 +1097,7 @@
1094
1097
  * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
1095
1098
  */
1096
1099
  const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
1097
- return tagName !== 'annotation-xml' && tagName.indexOf('-') > 0;
1100
+ return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
1098
1101
  };
1099
1102
 
1100
1103
  /**