Last active
December 30, 2015 14:09
-
-
Save yene/7840570 to your computer and use it in GitHub Desktop.
Custom marked renderer for gist code quotes
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
var r = new marked.Renderer() | |
var oldCode = r.code; | |
r.code = function(code, lang) { | |
if (lang === "gist") { | |
return '<code gist="https://gist.github.com/' + code + '.json"></code>'; | |
} else { | |
return oldCode(code, lang); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment