aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/js/fileview.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/js/fileview.js')
-rw-r--r--src/main/resources/js/fileview.js7
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";