Permalink
Browse files

fix conflict with Gist.

  • Loading branch information...
1 parent 1c7c00a commit 575993b0b12f12b4d93c6630a5dc4b1de0a03d0f @raimon49 committed Apr 15, 2012
Showing with 13 additions and 3 deletions.
  1. +13 −3 prettify.rb
View
@@ -24,10 +24,16 @@
addEvent(window, 'load', function() {
var div = document.getElementsByTagName("div");
for (var i=0, len=div.length; i<len; i++) {
- if(div[i].className !== "body") continue;
+ if(div[i].className !== "body") {
+ continue;
+ }
var pre = div[i].getElementsByTagName("pre");
for(var j=0, plen=pre.length; j<plen; j++) {
+ if (pre[j].parentNode.className.indexOf("gist-highlight") !== -1) {
+ continue;
+ }
+
pre[j].className = highligntClass;
}
}
@@ -37,11 +43,15 @@
var onNodeInserted = function(e) {
var node = e.target;
var pre = node.getElementsByTagName("pre");
-
+
for (var i=0, len=pre.length; i<len; i++) {
+ if (pre[j].parentNode.className.indexOf("gist-highlight") !== -1) {
+ continue;
+ }
+
pre[i].className = highligntClass;
}
-
+
if (i > 0) {
prettyPrint();
}

0 comments on commit 575993b

Please sign in to comment.