rem: } else if (/THEAD|TBODY|TFOOT/.test(node.nodeName)) { var rows = nodeName=='THEAD' ? hrows : nodeName=='TFOOT' ? frows : brows; 
add: } else if (/thead|tbody|tfoot/i.test(node.nodeName)) { var rows = nodeName=='thead' ? hrows : nodeName=='tfoot' ? frows : brows; 
context:     this._fixTableHelper = function(table) {        /* the code to actually fix tables */        var doc = this.editor.getInnerDocument();        var thead = doc.createElement('thead');        var tbody = doc.createElement('tbody');        var tfoot = doc.createElement('tfoot');        var table_classes = this.editor.config.table_classes;        function cleanClassName(name) {            var allowed_classes = table_classes['class'];            for (var i = 0; i < allowed_classes.length; i++) {                var classname = allowed_classes[i];                classname = classname.classname || classname;                if (classname==name) return name;            };            return allowed_classes[0];        }        if (table_classes) {            table.className = cleanClassName(table.className);        } else {            table.removeAttribute('class');            table.removeAttribute('className');        };        table.removeAttribute('border');        table.removeAttribute('cellpadding');        table.removeAttribute('cellPadding');        table.removeAttribute('cellspacing');        table.removeAttribute('cellSpacing');        // now get all the rows of the table, the rows can either be        // direct descendants of the table or inside a 'tbody', 'thead'        // or 'tfoot' element        var hrows = [], brows = [], frows = [];        for (var node = table.firstChild; node; node = node.nextSibling) {            var nodeName = node.nodeName;            if (/TR/.test(node.nodeName)) {                brows.push(node);            } else if (/THEAD|TBODY|TFOOT/.test(node.nodeName)) {                var rows = nodeName=='THEAD' ? hrows : nodeName=='TFOOT' ? frows : brows;                for (var inode = node.firstChild; inode; inode = inode.nextSibling) {                    if (/TR/.test(inode.nodeName)) {                        rows.push(inode);                    };                };            };        };        /* Extract thead and tfoot from tbody */        while (brows.length && !this._isBodyRow(brows[0])) {            hrows.push(brows[0]);            brows.shift();        }        while (brows.length && !this._isBodyRow(brows[brows.length-1])) {            var last = brows[brows.length-1];            brows.length -= 1;            frows.unshift(last);        }        // now find out how many cells our rows should have        var numcols = this._countCols(hrows, 0);        numcols = this._countCols(brows, numcols);        numcols = this._countCols(frows, numcols);        // now walk through all rows to clean them up        this._cleanRows(hrows, thead);        this._cleanRows(brows, tbody);        this._cleanRows(frows, tfoot);        // now remove all the old stuff from the table and add the new        // tbody        while (table.firstChild) {            table.removeChild(table.firstChild);        }        if (hrows.length) {            table.appendChild(thead);        }        if (brows.length) {            table.appendChild(tbody);        }        if (frows.length) {            table.appendChild(tfoot);        }    };
meta: 2380	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/2380/2d8706428efbec3e2798eaafec7205a7efd24de6/kupubasetools.js/clean/kupu/common/kupubasetools.js