html-react-parser 5.2.0 → 5.2.1
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.
|
@@ -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.
|