hoeditor-web 2.0.105 → 2.0.107

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.
@@ -3,7 +3,7 @@
3
3
  /***/ 27856:
4
4
  /***/ (function(module) {
5
5
 
6
- /*! @license DOMPurify 2.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.0/LICENSE */
6
+ /*! @license DOMPurify 2.3.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.8/LICENSE */
7
7
 
8
8
  (function (global, factory) {
9
9
  true ? module.exports = factory() :
@@ -159,9 +159,7 @@
159
159
  }
160
160
  /* Add properties to a lookup table */
161
161
 
162
- function addToSet(set, array, transformCaseFunc) {
163
- transformCaseFunc = transformCaseFunc ? transformCaseFunc : stringToLowerCase;
164
-
162
+ function addToSet(set, array) {
165
163
  if (setPrototypeOf) {
166
164
  // Make 'in' and truthy checks like Boolean(set.constructor)
167
165
  // independent of any properties defined on Object.prototype.
@@ -175,7 +173,7 @@
175
173
  var element = array[l];
176
174
 
177
175
  if (typeof element === 'string') {
178
- var lcElement = transformCaseFunc(element);
176
+ var lcElement = stringToLowerCase(element);
179
177
 
180
178
  if (lcElement !== element) {
181
179
  // Config presets (e.g. tags.js, attrs.js) are immutable.
@@ -304,9 +302,6 @@
304
302
  return trustedTypes.createPolicy(policyName, {
305
303
  createHTML: function createHTML(html) {
306
304
  return html;
307
- },
308
- createScriptURL: function createScriptURL(scriptUrl) {
309
- return scriptUrl;
310
305
  }
311
306
  });
312
307
  } catch (_) {
@@ -330,7 +325,7 @@
330
325
  */
331
326
 
332
327
 
333
- DOMPurify.version = '2.4.0';
328
+ DOMPurify.version = '2.3.8';
334
329
  /**
335
330
  * Array of elements that DOMPurify removed during sanitation.
336
331
  * Empty if nothing was removed.
@@ -488,27 +483,9 @@
488
483
  * case Trusted Types are not supported */
489
484
 
490
485
  var RETURN_TRUSTED_TYPE = false;
491
- /* Output should be free from DOM clobbering attacks?
492
- * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
493
- */
486
+ /* Output should be free from DOM clobbering attacks? */
494
487
 
495
488
  var SANITIZE_DOM = true;
496
- /* Achieve full DOM Clobbering protection by isolating the namespace of named
497
- * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
498
- *
499
- * HTML/DOM spec rules that enable DOM Clobbering:
500
- * - Named Access on Window (§7.3.3)
501
- * - DOM Tree Accessors (§3.1.5)
502
- * - Form Element Parent-Child Relations (§4.10.3)
503
- * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
504
- * - HTMLCollection (§4.2.10.2)
505
- *
506
- * Namespace isolation is implemented by prefixing `id` and `name` attributes
507
- * with a constant string, i.e., `user-content-`
508
- */
509
-
510
- var SANITIZE_NAMED_PROPS = false;
511
- var SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
512
489
  /* Keep element content when removing element? */
513
490
 
514
491
  var KEEP_CONTENT = true;
@@ -578,29 +555,15 @@
578
555
 
579
556
 
580
557
  cfg = clone(cfg);
581
- PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
582
- SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
583
-
584
- transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? function (x) {
585
- return x;
586
- } : stringToLowerCase;
587
558
  /* Set configuration parameters */
588
559
 
589
- ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
590
- ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
591
- URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent
592
- cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent
593
- transformCaseFunc // eslint-disable-line indent
594
- ) // eslint-disable-line indent
595
- : DEFAULT_URI_SAFE_ATTRIBUTES;
596
- DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent
597
- cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent
598
- transformCaseFunc // eslint-disable-line indent
599
- ) // eslint-disable-line indent
600
- : DEFAULT_DATA_URI_TAGS;
601
- FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
602
- FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
603
- FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
560
+ ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;
561
+ ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;
562
+ URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;
563
+ DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;
564
+ FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS) : DEFAULT_FORBID_CONTENTS;
565
+ FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};
566
+ FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};
604
567
  USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
605
568
  ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
606
569
 
@@ -622,8 +585,6 @@
622
585
 
623
586
  SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
624
587
 
625
- SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
626
-
627
588
  KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
628
589
 
629
590
  IN_PLACE = cfg.IN_PLACE || false; // Default false
@@ -643,6 +604,13 @@
643
604
  CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
644
605
  }
645
606
 
607
+ PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes
608
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
609
+
610
+ transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? function (x) {
611
+ return x;
612
+ } : stringToLowerCase;
613
+
646
614
  if (SAFE_FOR_TEMPLATES) {
647
615
  ALLOW_DATA_ATTR = false;
648
616
  }
@@ -688,7 +656,7 @@
688
656
  ALLOWED_TAGS = clone(ALLOWED_TAGS);
689
657
  }
690
658
 
691
- addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
659
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);
692
660
  }
693
661
 
694
662
  if (cfg.ADD_ATTR) {
@@ -696,11 +664,11 @@
696
664
  ALLOWED_ATTR = clone(ALLOWED_ATTR);
697
665
  }
698
666
 
699
- addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
667
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);
700
668
  }
701
669
 
702
670
  if (cfg.ADD_URI_SAFE_ATTR) {
703
- addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
671
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);
704
672
  }
705
673
 
706
674
  if (cfg.FORBID_CONTENTS) {
@@ -708,7 +676,7 @@
708
676
  FORBID_CONTENTS = clone(FORBID_CONTENTS);
709
677
  }
710
678
 
711
- addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
679
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS);
712
680
  }
713
681
  /* Add #text in case KEEP_CONTENT is set to true */
714
682
 
@@ -1280,34 +1248,6 @@
1280
1248
  if (!_isValidAttribute(lcTag, lcName, value)) {
1281
1249
  continue;
1282
1250
  }
1283
- /* Full DOM Clobbering protection via namespace isolation,
1284
- * Prefix id and name attributes with `user-content-`
1285
- */
1286
-
1287
-
1288
- if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
1289
- // Remove the attribute with this value
1290
- _removeAttribute(name, currentNode); // Prefix the value and later re-create the attribute with the sanitized value
1291
-
1292
-
1293
- value = SANITIZE_NAMED_PROPS_PREFIX + value;
1294
- }
1295
- /* Handle attributes that require Trusted Types */
1296
-
1297
-
1298
- if (trustedTypesPolicy && _typeof(trustedTypes) === 'object' && typeof trustedTypes.getAttributeType === 'function') {
1299
- if (namespaceURI) ; else {
1300
- switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1301
- case 'TrustedHTML':
1302
- value = trustedTypesPolicy.createHTML(value);
1303
- break;
1304
-
1305
- case 'TrustedScriptURL':
1306
- value = trustedTypesPolicy.createScriptURL(value);
1307
- break;
1308
- }
1309
- }
1310
- }
1311
1251
  /* Handle invalid data-* attribute set by try-catching it */
1312
1252
 
1313
1253
 
@@ -1378,8 +1318,7 @@
1378
1318
  // eslint-disable-next-line complexity
1379
1319
 
1380
1320
 
1381
- DOMPurify.sanitize = function (dirty) {
1382
- var cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1321
+ DOMPurify.sanitize = function (dirty, cfg) {
1383
1322
  var body;
1384
1323
  var importedNode;
1385
1324
  var currentNode;
@@ -8,12 +8,12 @@
8
8
  /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
9
9
  var $ = __webpack_require__(82109);
10
10
  var uncurryThis = __webpack_require__(1702);
11
- var $indexOf = (__webpack_require__(41318).indexOf);
11
+ var $IndexOf = (__webpack_require__(41318).indexOf);
12
12
  var arrayMethodIsStrict = __webpack_require__(9341);
13
13
 
14
- var nativeIndexOf = uncurryThis([].indexOf);
14
+ var un$IndexOf = uncurryThis([].indexOf);
15
15
 
16
- var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
16
+ var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
17
17
  var STRICT_METHOD = arrayMethodIsStrict('indexOf');
18
18
 
19
19
  // `Array.prototype.indexOf` method
@@ -23,8 +23,8 @@ $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
23
23
  var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
24
24
  return NEGATIVE_ZERO
25
25
  // convert -0 to +0
26
- ? nativeIndexOf(this, searchElement, fromIndex) || 0
27
- : $indexOf(this, searchElement, fromIndex);
26
+ ? un$IndexOf(this, searchElement, fromIndex) || 0
27
+ : $IndexOf(this, searchElement, fromIndex);
28
28
  }
29
29
  });
30
30
 
@@ -68,7 +68,7 @@ var $ = __webpack_require__(82109);
68
68
  var uncurryThis = __webpack_require__(1702);
69
69
  var isArray = __webpack_require__(43157);
70
70
 
71
- var nativeReverse = uncurryThis([].reverse);
71
+ var un$Reverse = uncurryThis([].reverse);
72
72
  var test = [1, 2];
73
73
 
74
74
  // `Array.prototype.reverse` method
@@ -79,7 +79,7 @@ $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()
79
79
  reverse: function reverse() {
80
80
  // eslint-disable-next-line no-self-assign -- dirty hack
81
81
  if (isArray(this)) this.length = this.length;
82
- return nativeReverse(this);
82
+ return un$Reverse(this);
83
83
  }
84
84
  });
85
85
 
@@ -620,7 +620,7 @@ __webpack_require__.d(__webpack_exports__, {
620
620
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.js
621
621
  var es_promise = __webpack_require__(88674);
622
622
  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
623
- var asyncToGenerator = __webpack_require__(81448);
623
+ var asyncToGenerator = __webpack_require__(39873);
624
624
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
625
625
  var es_string_match = __webpack_require__(4723);
626
626
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.replace.js
@@ -632,7 +632,7 @@ var es_array_iterator = __webpack_require__(66992);
632
632
  // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
633
633
  var web_dom_collections_iterator = __webpack_require__(33948);
634
634
  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
635
- var defineProperty = __webpack_require__(78255);
635
+ var defineProperty = __webpack_require__(7067);
636
636
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.reduce.js
637
637
  var es_array_reduce = __webpack_require__(85827);
638
638
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.ends-with.js