diff --git a/app/stage/protyle/js/protyle-html.js b/app/stage/protyle/js/protyle-html.js index 9fa38ac0c..e3072ef4b 100644 --- a/app/stage/protyle/js/protyle-html.js +++ b/app/stage/protyle/js/protyle-html.js @@ -22,13 +22,14 @@ class ProtyleHtml extends HTMLElement { const scripts = el.getElementsByTagName('script') let fatalHTML = '' for (let i = 0; i < scripts.length; i++) { - const s = document.createElement('script') if (scripts[i].textContent.indexOf('document.write') > -1) { - fatalHTML += `
${window.siyuan.languages.htmlBlockError}
` + fatalHTML += `
${window.siyuan.languages.htmlBlockError}
+` } else { + const s = document.createElement('script') s.textContent = scripts[i].textContent + this.display.appendChild(s) } - this.display.appendChild(s) } if (fatalHTML) { this.display.innerHTML += fatalHTML