@bobfrankston/rmfmail 1.1.237 → 1.1.238

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.
@@ -2699,20 +2699,14 @@ function showSuggestionsMenu2(parentDoc, x, y, items) {
2699
2699
  }, 0);
2700
2700
  }
2701
2701
  function replaceMarker(editor2, marker, replacement) {
2702
- const doc = editor2.getDoc();
2703
- const range = doc.createRange();
2704
- range.selectNode(marker);
2705
- const sel = doc.getSelection();
2706
- if (!sel)
2707
- return;
2708
- sel.removeAllRanges();
2709
- sel.addRange(range);
2710
2702
  try {
2711
- if (!doc.execCommand("insertText", false, replacement)) {
2712
- range.deleteContents();
2713
- range.insertNode(doc.createTextNode(replacement));
2714
- }
2703
+ editor2.focus();
2704
+ editor2.selection.select(marker);
2705
+ editor2.insertContent(editor2.dom.encode(replacement));
2715
2706
  } catch {
2707
+ const doc = editor2.getDoc();
2708
+ const range = doc.createRange();
2709
+ range.selectNode(marker);
2716
2710
  range.deleteContents();
2717
2711
  range.insertNode(doc.createTextNode(replacement));
2718
2712
  }