From 6a4131ffd3f019cb8af62a5099f919d58fcdf344 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 8 Jul 2020 19:45:49 +0900 Subject: [PATCH] Allow autoinsert to work in IE11 --- modules/editor/skins/simpleeditor/js/simpleeditor.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/editor/skins/simpleeditor/js/simpleeditor.js b/modules/editor/skins/simpleeditor/js/simpleeditor.js index f6c7a9a1c..a8181b04e 100644 --- a/modules/editor/skins/simpleeditor/js/simpleeditor.js +++ b/modules/editor/skins/simpleeditor/js/simpleeditor.js @@ -31,7 +31,12 @@ var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); - document.execCommand('insertHTML', false, content); + if (String(navigator.userAgent).match(/Trident\/7/)) { + range.insertNode(range.createContextualFragment(content)); + range.collapse(false); + } else { + document.execCommand('insertHTML', false, content); + } }; // Simplify HTML content by removing unnecessary tags.