Skip to content

Instantly share code, notes, and snippets.

@yene
Last active December 30, 2015 14:09
Show Gist options
  • Save yene/7840570 to your computer and use it in GitHub Desktop.
Save yene/7840570 to your computer and use it in GitHub Desktop.
Custom marked renderer for gist code quotes
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