contentoh-components-library 21.2.20 → 21.2.21

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>").replace(/\&(nbsp;|amp;)/gm, " ");
65
+ var temp = value.replace(/\n/gm, "<br>").replace(/\&nbsp;/gm, " ").replace(/\&amp;/gm, "&");
66
66
  return temp;
67
67
  }; //const quillRef = useRef();
68
68
 
@@ -74,7 +74,7 @@ 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, "").replace(/\&(nbsp;|amp;)/gm, " ");
77
+ return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(/\&nbsp;/gm, " ").replace(/\&amp;/gm, "&");
78
78
  };
79
79
 
80
80
  var _onChange = function onChange(valueInput, delta, user, h) {
@@ -82,7 +82,7 @@ var InputFormatter = function InputFormatter(_ref) {
82
82
 
83
83
  try {
84
84
  if (h.getLength() - 1 <= maxLength) {
85
- var unformattedText = valueInput.replace(/<li.*?>/gm, " - ").replace(/<\/li>/gm, "\n").replace(/<\/p><p>/gm, "\n").replaceAll(/<\/?(?!\/?strong).*?>/gm, "").replace(/\&(nbsp;|amp;)/gm, " ");
85
+ var unformattedText = valueInput.replace(/<li.*?>/gm, " - ").replace(/<\/li>/gm, "\n").replace(/<\/p><p>/gm, "\n").replaceAll(/<\/?(?!\/?strong).*?>/gm, "").replace(/\&nbsp;/gm, " ").replace(/\&amp;/gm, "&");
86
86
  setInputValue(valueInput);
87
87
  value = unformattedText;
88
88
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.2.20",
3
+ "version": "21.2.21",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -22,7 +22,10 @@ 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>").replace(/\&(nbsp;|amp;)/gm, " ");
25
+ let temp = value
26
+ .replace(/\n/gm, "<br>")
27
+ .replace(/\&nbsp;/gm, " ")
28
+ .replace(/\&amp;/gm, "&");
26
29
  return temp;
27
30
  };
28
31
 
@@ -37,7 +40,8 @@ export const InputFormatter = ({
37
40
  return value
38
41
  .replace(/<\/p><p>/gm, "\n")
39
42
  .replace(/<\/?br>|<\/?p>/gm, "")
40
- .replace(/\&(nbsp;|amp;)/gm, " ");
43
+ .replace(/\&nbsp;/gm, " ")
44
+ .replace(/\&amp;/gm, "&");
41
45
  };
42
46
 
43
47
  const onChange = (valueInput, delta, user, h) => {
@@ -49,7 +53,8 @@ export const InputFormatter = ({
49
53
  .replace(/<\/li>/gm, "\n")
50
54
  .replace(/<\/p><p>/gm, "\n")
51
55
  .replaceAll(/<\/?(?!\/?strong).*?>/gm, "")
52
- .replace(/\&(nbsp;|amp;)/gm, " ");
56
+ .replace(/\&nbsp;/gm, " ")
57
+ .replace(/\&amp;/gm, "&");
53
58
  setInputValue(valueInput);
54
59
  value = unformattedText;
55
60
  } else {