From 14ef31de55ac66208941f0079ef3cf608721e747 Mon Sep 17 00:00:00 2001 From: Mats Eikeland Mollestad Date: Tue, 20 Oct 2020 20:05:07 +0200 Subject: [PATCH] [js] Updated markdown renderer --- Public/assets/js/markdown-renderer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Public/assets/js/markdown-renderer.js b/Public/assets/js/markdown-renderer.js index 174f956..7a7aacb 100644 --- a/Public/assets/js/markdown-renderer.js +++ b/Public/assets/js/markdown-renderer.js @@ -25,7 +25,10 @@ function renderMarkdown(markdown) { let document = parser.parseFromString(html, "text/html") Array.from(document.getElementsByTagName("a")).map(x => x.setAttribute("target", "_blank")) Array.from(document.getElementsByTagName("img")).map(x => x.setAttribute("style", "max-width:100%")) + Array.from(document.getElementsByTagName("table")).map(x => x.setAttribute("style", "width:100%")) + Array.from(document.getElementsByTagName("td")).map(x => x.setAttribute("class", "px-1")) Array.from(document.getElementsByTagName("blockquote")).map(x => x.setAttribute("class", "blockquote")) + Array.from(document.getElementsByTagName("pre")).map(x => x.setAttribute("style", "line-height: 90%;")) return document.getElementsByTagName("body")[0].innerHTML }