2009/dap/ReSpec.js/js respec.js,1.177,1.178

Update of /sources/public/2009/dap/ReSpec.js/js
In directory hutz:/tmp/cvs-serv30224

Modified Files:
	respec.js 
Log Message:
in XHTML mode, don't escape inside style or script

Index: respec.js
===================================================================
RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- respec.js	29 Nov 2011 13:45:14 -0000	1.177
+++ respec.js	15 Dec 2011 16:28:15 -0000	1.178
@@ -385,7 +385,8 @@
             selfClosing[n] = true;
         });
         var dumpNode = function (node) {
-            var out = '' ;
+            var out = ''
+            ,   noEsc = [false];
             // 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]) ;
@@ -408,7 +409,9 @@
                     //     out += "\n" + node.innerHTML;
                     // } 
                     // else {
+                        noEsc.push(ename === "style" || ename === "script");
                         for (var i = 0; i < node.childNodes.length; i++) out += dumpNode(node.childNodes[i]);
+                        noEsc.pop();
                     // }
                     out += '</' + ename + '>';
                 }
@@ -419,7 +422,7 @@
             }
             // text or cdata
             else if (3 === node.nodeType || 4 === node.nodeType) {
-                out += pRef._esc(node.nodeValue);
+                out += noEsc[noEsc.length - 1] ? node.nodeValue : pRef._esc(node.nodeValue);
             }
             // we don't handle other types for the time being
             else {

Received on Thursday, 15 December 2011 16:28:22 UTC