Code formating.... whew

So I got some syntax highlighting using instructions found here Tips for software engineer. It seems to be using a version of the code that is not hosted at google code??? At least when I looked there was not a function/class dp.SyntaxHighlighter.HighlightAll in the shCore.js that I linked via svn . Instead if you look at the sources of this page you can find it minified and packed and placed right before the body ends. This is what I use to call it.
function FindTagsByName(container, name, Tag)  
    {  
        var elements = document.getElementsByTagName(Tag);  
        for (var i = 0; i < elements.length; i++)  
        {  
            if (elements[i].getAttribute("name") == name)  
            {  
                container.push(elements[i]);  
            }  
        }  
    }  
    var elements = [];  
    FindTagsByName(elements, "code", "pre");  
   
 for(var i=0; i < elements.length; i++) {  
 if(elements[i].nodeName.toUpperCase() == "PRE") {  
    brs = elements[i].getElementsByTagName("br");  
    for(var j = 0, brLength = brs.length; j < brLength; j++) {  
     var newNode = document.createTextNode("\n");  
     elements[i].replaceChild(newNode, brs[0]);  
   }  
  }  
 }  
dp.SyntaxHighlighter.HighlightAll("code")
Post a Comment

Popular posts from this blog