Skip to content

Commit

Permalink
Fixes #60 xss
Browse files Browse the repository at this point in the history
  • Loading branch information
volca committed Mar 7, 2017
1 parent 69b877d commit 1181f04
Show file tree
Hide file tree
Showing 6 changed files with 1,286 additions and 2 deletions.
1 change: 1 addition & 0 deletions js/config.js
Expand Up @@ -10,6 +10,7 @@ window.config = (function(hljs) {
gfm: true,
tables: true,
breaks: false,
sanitize: true,
highlight: function(code) {
return hljs.highlightAuto(code).value;
}
Expand Down
1 change: 1 addition & 0 deletions js/markdownify.js
Expand Up @@ -27,6 +27,7 @@
// Convert MarkDown to HTML without MathJax typesetting.
// This is done to make page responsiveness. The HTML body
// is replaced after MathJax typesetting.
config.markedOptions.sanitize = items.mathjax ? false : true;
marked.setOptions(config.markedOptions);
var html = marked(data);
$(document.body).html(html);
Expand Down

0 comments on commit 1181f04

Please sign in to comment.