Skip to content

Commit

Permalink
Merge pull request #82 from MatsMoll/develop
Browse files Browse the repository at this point in the history
[js] Updated markdown renderer
  • Loading branch information
MatsMoll authored Oct 20, 2020
2 parents e71382d + 14ef31d commit fac46df
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Public/assets/js/markdown-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit fac46df

Please sign in to comment.