Skip to content

Commit 2fd552e

Browse files
Merge remote-tracking branch 'remotes/github/2.3-develop' into EPAM-PR-30
2 parents a0d41ad + d1f9c6b commit 2fd552e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ define([
350350
* @param {String} content
351351
*/
352352
setContent: function (content) {
353-
this.get(this.getId()).execCommand('mceSetContent', false, content);
353+
this.get(this.getId()).setContent(content);
354354
},
355355

356356
/**
@@ -559,10 +559,12 @@ define([
559559
var selection = editor.selection,
560560
dom = editor.dom,
561561
rng = dom.createRng(),
562+
doc = editor.getDoc(),
562563
markerHtml,
563564
marker;
564565

565-
if (!selection.getContent().length) {
566+
// Validate the range we're trying to fix is contained within the current editors document
567+
if (!selection.getContent().length && jQuery.contains(doc, selection.getRng().startContainer)) {
566568
markerHtml = '<span id="mce_marker" data-mce-type="bookmark">\uFEFF</span>';
567569
selection.setContent(markerHtml);
568570
marker = dom.get('mce_marker');

0 commit comments

Comments
 (0)