Skip to content

Instantly share code, notes, and snippets.

@andy-williams
Created March 24, 2014 17:44
Show Gist options
  • Save andy-williams/9745329 to your computer and use it in GitHub Desktop.
Save andy-williams/9745329 to your computer and use it in GitHub Desktop.
add prettyprint class dynamically - to be used in conjunction with https://code.google.com/p/google-code-prettify/
;(function() {
var pres = document.getElementsByTagName("pre");
for(var i=0; i < pres.length; i++) {
if(pres[i].getElementsByTagName('code').length > 0)
{
pres[i].className += "prettyprint";
}
}
prettyPrint();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment