*** prettify.js Mon Mar 10 23:56:56 2008 --- prettify-r35-ie-hack.js Tue Mar 4 13:23:34 2008 *************** *** 114,124 **** return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); } ! function PR_isIE6() { ! var isIE6 = navigator && navigator.userAgent ! && /\bMSIE 6\./.test(navigator.userAgent); ! PR_isIE6 = function () { return isIE6; } ! return isIE6; } /** Splice one array into another. --- 114,125 ---- return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); } ! function PR_isIE() { ! var isIE = navigator && navigator.userAgent ! && (/\bMSIE 6\./.test(navigator.userAgent) ! || /\bMSIE 7\./.test(navigator.userAgent)); ! PR_isIE = function () { return isIE; } ! return isIE; } /** Splice one array into another. *************** *** 934,940 **** * has been finished. */ function prettyPrint(opt_whenDone) { ! var isIE6 = PR_isIE6(); // fetch a list of nodes to rewrite var codeSegments = [ --- 935,941 ---- * has been finished. */ function prettyPrint(opt_whenDone) { ! var isIE = PR_isIE(); // fetch a list of nodes to rewrite var codeSegments = [ *************** *** 1007,1018 **** // Doing this on other browsers breaks lots of stuff since \r\n is // treated as two newlines on Firefox, and doing this also slows down // rendering. ! if (isIE6 && cs.tagName === 'PRE') { var lineBreaks = cs.getElementsByTagName('br'); for (var i = lineBreaks.length; --i >= 0;) { var lineBreak = lineBreaks[i]; lineBreak.parentNode.replaceChild( ! document.createTextNode('\r\n'), lineBreak); } } } --- 1008,1019 ---- // Doing this on other browsers breaks lots of stuff since \r\n is // treated as two newlines on Firefox, and doing this also slows down // rendering. ! if (isIE && cs.tagName === 'PRE') { var lineBreaks = cs.getElementsByTagName('br'); for (var i = lineBreaks.length; --i >= 0;) { var lineBreak = lineBreaks[i]; lineBreak.parentNode.replaceChild( ! document.createTextNode('\r'), lineBreak); } } }