html-react-parser 5.2.0 → 5.2.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.
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
function requireNode () {
|
|
107
107
|
if (hasRequiredNode) return node;
|
|
108
108
|
hasRequiredNode = 1;
|
|
109
|
-
var __extends = (node
|
|
109
|
+
var __extends = (node.__extends) || (function () {
|
|
110
110
|
var extendStatics = function (d, b) {
|
|
111
111
|
extendStatics = Object.setPrototypeOf ||
|
|
112
112
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
122
122
|
};
|
|
123
123
|
})();
|
|
124
|
-
var __assign = (node
|
|
124
|
+
var __assign = (node.__assign) || function () {
|
|
125
125
|
__assign = Object.assign || function(t) {
|
|
126
126
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
127
127
|
s = arguments[i];
|
|
@@ -588,7 +588,7 @@
|
|
|
588
588
|
if (hasRequiredLib$2) return lib$2;
|
|
589
589
|
hasRequiredLib$2 = 1;
|
|
590
590
|
(function (exports) {
|
|
591
|
-
var __createBinding = (lib$2
|
|
591
|
+
var __createBinding = (lib$2.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
592
592
|
if (k2 === undefined) k2 = k;
|
|
593
593
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
594
594
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -599,7 +599,7 @@
|
|
|
599
599
|
if (k2 === undefined) k2 = k;
|
|
600
600
|
o[k2] = m[k];
|
|
601
601
|
}));
|
|
602
|
-
var __exportStar = (lib$2
|
|
602
|
+
var __exportStar = (lib$2.__exportStar) || function(m, exports) {
|
|
603
603
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
604
604
|
};
|
|
605
605
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -765,7 +765,7 @@
|
|
|
765
765
|
hasRequiredConstants = 1;
|
|
766
766
|
(function (exports) {
|
|
767
767
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
768
|
-
exports.CASE_SENSITIVE_TAG_NAMES_MAP = exports.CASE_SENSITIVE_TAG_NAMES = void 0;
|
|
768
|
+
exports.CARRIAGE_RETURN_PLACEHOLDER_REGEX = exports.CARRIAGE_RETURN_PLACEHOLDER = exports.CARRIAGE_RETURN_REGEX = exports.CARRIAGE_RETURN = exports.CASE_SENSITIVE_TAG_NAMES_MAP = exports.CASE_SENSITIVE_TAG_NAMES = void 0;
|
|
769
769
|
/**
|
|
770
770
|
* SVG elements are case-sensitive.
|
|
771
771
|
*
|
|
@@ -808,6 +808,10 @@
|
|
|
808
808
|
accumulator[tagName.toLowerCase()] = tagName;
|
|
809
809
|
return accumulator;
|
|
810
810
|
}, {});
|
|
811
|
+
exports.CARRIAGE_RETURN = '\r';
|
|
812
|
+
exports.CARRIAGE_RETURN_REGEX = new RegExp(exports.CARRIAGE_RETURN, 'g');
|
|
813
|
+
exports.CARRIAGE_RETURN_PLACEHOLDER = "__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(), "__");
|
|
814
|
+
exports.CARRIAGE_RETURN_PLACEHOLDER_REGEX = new RegExp(exports.CARRIAGE_RETURN_PLACEHOLDER, 'g');
|
|
811
815
|
|
|
812
816
|
} (constants));
|
|
813
817
|
return constants;
|
|
@@ -873,7 +877,7 @@
|
|
|
873
877
|
* @returns - HTML string with escaped special characters.
|
|
874
878
|
*/
|
|
875
879
|
function escapeSpecialCharacters(html) {
|
|
876
|
-
return html.replace(
|
|
880
|
+
return html.replace(constants_1.CARRIAGE_RETURN_REGEX, constants_1.CARRIAGE_RETURN_PLACEHOLDER);
|
|
877
881
|
}
|
|
878
882
|
/**
|
|
879
883
|
* Reverts escaped special characters back to actual characters.
|
|
@@ -882,7 +886,7 @@
|
|
|
882
886
|
* @returns - Text with escaped characters reverted.
|
|
883
887
|
*/
|
|
884
888
|
function revertEscapedCharacters(text) {
|
|
885
|
-
return text.replace(
|
|
889
|
+
return text.replace(constants_1.CARRIAGE_RETURN_PLACEHOLDER_REGEX, constants_1.CARRIAGE_RETURN);
|
|
886
890
|
}
|
|
887
891
|
/**
|
|
888
892
|
* Transforms DOM nodes to `domhandler` nodes.
|
|
@@ -1100,7 +1104,7 @@
|
|
|
1100
1104
|
function requireHtmlToDom () {
|
|
1101
1105
|
if (hasRequiredHtmlToDom) return htmlToDom;
|
|
1102
1106
|
hasRequiredHtmlToDom = 1;
|
|
1103
|
-
var __importDefault = (htmlToDom
|
|
1107
|
+
var __importDefault = (htmlToDom.__importDefault) || function (mod) {
|
|
1104
1108
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1105
1109
|
};
|
|
1106
1110
|
Object.defineProperty(htmlToDom, "__esModule", { value: true });
|
|
@@ -2439,7 +2443,7 @@
|
|
|
2439
2443
|
function requireCjs$1 () {
|
|
2440
2444
|
if (hasRequiredCjs$1) return cjs$1;
|
|
2441
2445
|
hasRequiredCjs$1 = 1;
|
|
2442
|
-
var __importDefault = (cjs$1
|
|
2446
|
+
var __importDefault = (cjs$1.__importDefault) || function (mod) {
|
|
2443
2447
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2444
2448
|
};
|
|
2445
2449
|
Object.defineProperty(cjs$1, "__esModule", { value: true });
|
|
@@ -2580,7 +2584,7 @@
|
|
|
2580
2584
|
if (hasRequiredUtilities) return utilities$1;
|
|
2581
2585
|
hasRequiredUtilities = 1;
|
|
2582
2586
|
(function (exports) {
|
|
2583
|
-
var __importDefault = (utilities$1
|
|
2587
|
+
var __importDefault = (utilities$1.__importDefault) || function (mod) {
|
|
2584
2588
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2585
2589
|
};
|
|
2586
2590
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -2775,7 +2779,7 @@
|
|
|
2775
2779
|
function requireDomToReact () {
|
|
2776
2780
|
if (hasRequiredDomToReact) return domToReact;
|
|
2777
2781
|
hasRequiredDomToReact = 1;
|
|
2778
|
-
var __importDefault = (domToReact
|
|
2782
|
+
var __importDefault = (domToReact.__importDefault) || function (mod) {
|
|
2779
2783
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2780
2784
|
};
|
|
2781
2785
|
Object.defineProperty(domToReact, "__esModule", { value: true });
|
|
@@ -2905,7 +2909,7 @@
|
|
|
2905
2909
|
if (hasRequiredLib) return lib$3;
|
|
2906
2910
|
hasRequiredLib = 1;
|
|
2907
2911
|
(function (exports) {
|
|
2908
|
-
var __importDefault = (lib$3
|
|
2912
|
+
var __importDefault = (lib$3.__importDefault) || function (mod) {
|
|
2909
2913
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2910
2914
|
};
|
|
2911
2915
|
Object.defineProperty(exports, "__esModule", { value: true });
|