Skip to content

Instantly share code, notes, and snippets.

@watermint
Created March 31, 2013 02:41
Show Gist options
  • Save watermint/5279281 to your computer and use it in GitHub Desktop.
Save watermint/5279281 to your computer and use it in GitHub Desktop.
google-code-prettifyを適用する
function sourcecolon(source){
var body = document.documentElement.childNodes[1];
var tag = document.createElement("code");
tag.className = "prettyprint";
tag.innerHTML = source.code;
body.appendChild(tag);
prettyPrint();
var printed = document.innerHTML;
body.removeChild(tag);
return printed;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment