diff options
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"; |