diff options
author | Marvin Borner | 2019-04-15 19:59:37 +0200 |
---|---|---|
committer | Marvin Borner | 2019-04-15 19:59:37 +0200 |
commit | 1ee7bb209d0f3a66b00d34edc57661e31a846e49 (patch) | |
tree | c627c8ec0ddf63c6e0cbd5804d8711983e9f8120 /src/main/resources/js/fileview.js | |
parent | 85654224957a5d6c68e3060d706137cfd02d8a06 (diff) |
Added file preview css reset via iframe
Diffstat (limited to 'src/main/resources/js/fileview.js')
-rw-r--r-- | src/main/resources/js/fileview.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/resources/js/fileview.js b/src/main/resources/js/fileview.js index c34ce27..78ed951 100644 --- a/src/main/resources/js/fileview.js +++ b/src/main/resources/js/fileview.js @@ -12,9 +12,10 @@ const originalContent = content.innerText; if (extension === "md" || extension === "html") { if (extension === "md") - preview.innerHTML = marked(originalContent); - else if (extension === "html") - preview.innerHTML = marked(originalContent); + preview.src = "data:text/html;charset=utf-8," + encodeURI(marked(originalContent)); + else if (extension === "html") { + preview.src = "data:text/html;charset=utf-8," + encodeURI(originalContent); + } preview.style.display = "block"; raw.style.display = "block"; |