From 30d37cb0a2ec5d4a981bd4cb11924a7b1ec736e8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 30 Aug 2022 23:06:11 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/5762 --- app/stage/protyle/js/protyle-html.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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