Created
March 10, 2020 07:36
-
-
Save kartiknair/45176df0f4bba8d59914c7acd4737d39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const marked = require("marked"); | |
marked.setOptions({ | |
renderer: new marked.Renderer(), | |
highlight: function(code, language) { | |
const hljs = require("highlight.js"); | |
const validLanguage = hljs.getLanguage(language) ? language : "plaintext"; | |
return hljs.highlight(validLanguage, code).value; | |
}, | |
pedantic: false, | |
gfm: true, | |
breaks: false, | |
sanitize: false, | |
smartLists: true, | |
smartypants: false, | |
xhtml: false | |
}); | |
module.exports = marked; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment