Skip to content

Instantly share code, notes, and snippets.

@maxgillett
Created August 4, 2012 04:35
Show Gist options
  • Save maxgillett/3254562 to your computer and use it in GitHub Desktop.
Save maxgillett/3254562 to your computer and use it in GitHub Desktop.
<link rel="stylesheet"
href="http://yandex.st/highlightjs/6.1/styles/zenburn.min.css">
<style>
code {
font-family: monospace;
overflow: auto;
}
</style>
<script src='http://yandex.st/highlightjs/6.1/highlight.min.js'></script>
<script type="text/javascript">
$(document).ready(function() {
var codeCommentRegexp = /code\[(.+)\]/;
var match;
$("pre").parent().contents().filter(function(){
return this.nodeType == 8;
}).each(function(i, e){
if (match=codeCommentRegexp.exec(e.nodeValue)) {
try{
$(e).nextAll("pre").first().
find("code").addClass(match[1]);
} catch(e) {}
}
});
hljs.tabReplace = ' ';
hljs.initHighlightingOnLoad();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment