react-input-emoji 5.6.10 → 5.6.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +7 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/src/utils/input-event-utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -695,9 +695,11 @@ function totalCharacters(_ref2) {
|
|
695
695
|
* @return {string}
|
696
696
|
*/
|
697
697
|
function removeHtmlExceptBr(inputDiv) {
|
698
|
-
var temp = inputDiv.innerHTML.
|
699
|
-
var
|
700
|
-
|
698
|
+
var temp = inputDiv.innerHTML.replaceAll(/<br\s*\/?>/gi, "[BR]"); // temporarily replace <br> with placeholder
|
699
|
+
var tempContainer = document.createElement("div");
|
700
|
+
tempContainer.innerHTML = temp;
|
701
|
+
var stripped = tempContainer.innerText; // strip all html tags
|
702
|
+
var _final = stripped.replaceAll(/\[BR\]/gi, "</br>"); // replace placeholders with <br>
|
701
703
|
return _final;
|
702
704
|
}
|
703
705
|
|
@@ -732,7 +734,7 @@ function getSelectionStart$1(range) {
|
|
732
734
|
|
733
735
|
/**
|
734
736
|
*
|
735
|
-
* @
|
737
|
+
* @return {Object} cursor
|
736
738
|
*/
|
737
739
|
function getCursor() {
|
738
740
|
var selection = window.getSelection();
|
@@ -839,9 +841,7 @@ function replaceAllHtmlToString(html, shouldReturn) {
|
|
839
841
|
|
840
842
|
// remove all ↵ for safari
|
841
843
|
text = text.replace(/\n/gi, "");
|
842
|
-
|
843
|
-
tempContainer.innerHTML = text;
|
844
|
-
return tempContainer.innerText || "";
|
844
|
+
return text;
|
845
845
|
}
|
846
846
|
|
847
847
|
// @ts-check
|