mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
Pad: Fix <script>
elements in aceInitInnerdocbodyHead
hook
Using `.innerHTML` to create a `<script>` element does create a DOM node, but the script is not actually executed. Fortunately, creating a DocumentFragment does cause the script to execute.
This commit is contained in:
parent
7bdd0f2f09
commit
9fcd86b3cd
1 changed files with 2 additions and 3 deletions
|
@ -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')));
|
||||
|
||||
// <body> tag
|
||||
innerDocument.body.id = 'innerdocbody';
|
||||
|
|
Loading…
Reference in a new issue