- From: Robin Berjon via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 15 Dec 2011 16:57:43 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/ReSpec.js/js In directory hutz:/tmp/cvs-serv6273 Modified Files: respec.js Log Message: this should work better for noEsc Index: respec.js =================================================================== RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v retrieving revision 1.178 retrieving revision 1.179 diff -u -d -r1.178 -r1.179 --- respec.js 15 Dec 2011 16:28:15 -0000 1.178 +++ respec.js 15 Dec 2011 16:57:40 -0000 1.179 @@ -384,9 +384,9 @@ "br img input area base basefont col isindex link meta param hr".split(" ").forEach(function (n) { selfClosing[n] = true; }); + var noEsc = [false]; var dumpNode = function (node) { - var out = '' - , noEsc = [false]; + var out = ''; // if the node is the document node.. process the children if ( node.nodeType == 9 || ( node.nodeType == 1 && node.nodeName.toLowerCase() == 'html' ) ) { for (var i = 0; i < node.childNodes.length; i++) out += dumpNode(node.childNodes[i]) ; @@ -409,7 +409,9 @@ // out += "\n" + node.innerHTML; // } // else { + // console.log("NAME: " + ename); noEsc.push(ename === "style" || ename === "script"); + // console.log(noEsc); for (var i = 0; i < node.childNodes.length; i++) out += dumpNode(node.childNodes[i]); noEsc.pop(); // } @@ -422,6 +424,7 @@ } // text or cdata else if (3 === node.nodeType || 4 === node.nodeType) { + // console.log("TEXT: " + noEsc[noEsc.length - 1]); out += noEsc[noEsc.length - 1] ? node.nodeValue : pRef._esc(node.nodeValue); } // we don't handle other types for the time being
Received on Thursday, 15 December 2011 16:57:45 UTC