contentoh-components-library 21.1.60 → 21.1.61
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.
|
@@ -62,7 +62,7 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
62
62
|
var maxLength = maxChar ? maxChar : 999;
|
|
63
63
|
|
|
64
64
|
var getValue = function getValue(value) {
|
|
65
|
-
var temp = value.replace(/\n/gm, "<br>");
|
|
65
|
+
var temp = value.replace(/\n/gm, "<br>").replace(/&/gm, "&");
|
|
66
66
|
return temp;
|
|
67
67
|
}; //const quillRef = useRef();
|
|
68
68
|
|
|
@@ -74,11 +74,12 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
var valueFormater = function valueFormater(value) {
|
|
77
|
-
return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "");
|
|
77
|
+
return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(/&/gm, "&");
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
var _onChange = function onChange(valueInput, delta, user, h) {
|
|
81
81
|
var value = "";
|
|
82
|
+
console.log(valueInput, "valueInput");
|
|
82
83
|
|
|
83
84
|
try {
|
|
84
85
|
if (h.getLength() - 1 <= maxLength) {
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ export const InputFormatter = ({
|
|
|
22
22
|
const maxLength = maxChar ? maxChar : 999;
|
|
23
23
|
|
|
24
24
|
const getValue = (value) => {
|
|
25
|
-
let temp = value.replace(/\n/gm, "<br>");
|
|
25
|
+
let temp = value.replace(/\n/gm, "<br>").replace(/&/gm, "&");
|
|
26
26
|
return temp;
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -34,11 +34,15 @@ export const InputFormatter = ({
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const valueFormater = (value) => {
|
|
37
|
-
return value
|
|
37
|
+
return value
|
|
38
|
+
.replace(/<\/p><p>/gm, "\n")
|
|
39
|
+
.replace(/<\/?br>|<\/?p>/gm, "")
|
|
40
|
+
.replace(/&/gm, "&");
|
|
38
41
|
};
|
|
39
42
|
|
|
40
43
|
const onChange = (valueInput, delta, user, h) => {
|
|
41
44
|
let value = "";
|
|
45
|
+
console.log(valueInput, "valueInput");
|
|
42
46
|
try {
|
|
43
47
|
if (h.getLength() - 1 <= maxLength) {
|
|
44
48
|
let unformattedText = valueInput
|