diff --git a/src/static/js/ace.js b/src/static/js/ace.js index 0772648af..3471f4421 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -278,9 +278,8 @@ const Ace2Editor = function () { innerDocument.head.appendChild(innerStyle); const headLines = []; hooks.callAll('aceInitInnerdocbodyHead', {iframeHTML: headLines}); - const tmp = innerDocument.createElement('div'); - tmp.innerHTML = headLines.join('\n'); - while (tmp.firstChild) innerDocument.head.appendChild(tmp.firstChild); + innerDocument.head.appendChild( + innerDocument.createRange().createContextualFragment(headLines.join('\n'))); // tag innerDocument.body.id = 'innerdocbody';