react-input-emoji 5.6.9 → 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 CHANGED
@@ -688,9 +688,11 @@ function totalCharacters(_ref2) {
688
688
  * @return {string}
689
689
  */
690
690
  function removeHtmlExceptBr(inputDiv) {
691
- var temp = inputDiv.innerHTML.replace(/<br\s*\/?>/gi, "[BR]"); // temporarily replace <br> with placeholder
692
- var stripped = temp.replace(/<[^>]+>/g, ""); // strip all html tags
693
- var _final = stripped.replace(/\[BR\]/gi, "</br>"); // replace placeholders with <br>
691
+ var temp = inputDiv.innerHTML.replaceAll(/<br\s*\/?>/gi, "[BR]"); // temporarily replace <br> with placeholder
692
+ var tempContainer = document.createElement("div");
693
+ tempContainer.innerHTML = temp;
694
+ var stripped = tempContainer.innerText; // strip all html tags
695
+ var _final = stripped.replaceAll(/\[BR\]/gi, "</br>"); // replace placeholders with <br>
694
696
  return _final;
695
697
  }
696
698
 
@@ -725,7 +727,7 @@ function getSelectionStart$1(range) {
725
727
 
726
728
  /**
727
729
  *
728
- * @returns {Object} cursor
730
+ * @return {Object} cursor
729
731
  */
730
732
  function getCursor() {
731
733
  var selection = window.getSelection();
@@ -832,9 +834,7 @@ function replaceAllHtmlToString(html, shouldReturn) {
832
834
 
833
835
  // remove all ↵ for safari
834
836
  text = text.replace(/\n/gi, "");
835
- var tempContainer = document.createElement("div");
836
- tempContainer.innerHTML = text;
837
- return tempContainer.innerText || "";
837
+ return text;
838
838
  }
839
839
 
840
840
  // @ts-check
@@ -3655,6 +3655,10 @@ function EmojiPicker(props) {
3655
3655
  });
3656
3656
  return;
3657
3657
  }
3658
+ if (cacheI18n[language]) {
3659
+ setI18n(cacheI18n[language]);
3660
+ return;
3661
+ }
3658
3662
 
3659
3663
  // @ts-ignore
3660
3664
  fetch("".concat(EMOJI_MART_DATA_URL, "/i18n/").concat(language, ".json")).then(function (_x2) {