Created
July 18, 2012 20:08
-
-
Save jclement/3138548 to your computer and use it in GitHub Desktop.
Javascript function to decorate all pre/code blocks with "prettyPrint" for Google's code highlighting
This file contains hidden or 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
function styleCode() | |
{ | |
if (typeof disableStyleCode != "undefined") | |
{ | |
return; | |
} | |
var a = false; | |
$("pre code").parent().each(function() | |
{ | |
if (!$(this).hasClass("prettyprint")) | |
{ | |
$(this).addClass("prettyprint"); | |
a = true | |
} | |
}); | |
if (a) { prettyPrint() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment