W3C home > Mailing lists > Public > public-dap-commits@w3.org > December 2009

2009/dap/ReSpec.js/js respec.js,1.54,1.55

From: Robin Berjon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 02 Dec 2009 17:10:10 +0000
To: public-dap-commits@w3.org
Message-Id: <E1NFsiQ-000097-Cl@lionel-hutz.w3.org>
Update of /sources/public/2009/dap/ReSpec.js/js
In directory hutz:/tmp/cvs-serv436/js

Modified Files:
	respec.js 
Log Message:
fixed wrapping ISSUE-48

Index: respec.js
===================================================================
RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- respec.js	2 Dec 2009 11:27:24 -0000	1.54
+++ respec.js	2 Dec 2009 17:10:08 -0000	1.55
@@ -797,6 +797,7 @@
     },
     
     _norm:    function (str) {
+        str = str.replace(/^\s+/, "").replace(/\s+$/, "");
         return str.split(/\s+/).join(" ");
     },
     
@@ -897,7 +898,7 @@
     
     interfaceMember:    function (dt, dd) {
         var mem = { children: [] };
-        var str = dt.textContent;
+        var str = this._norm(dt.textContent);
         var extPrm = (sn.findNodes("dl[@class='parameters']", dd))[0];
         var excepts = sn.findNodes("*[@class='exception']", dd);
         var hadId = false;
@@ -1417,6 +1418,13 @@
         for (var i = 0; i < lvl; i++) str += "    ";
         return str;
     },
+
+    // XXX make this generally available (refactoring)
+    _norm:    function (str) {
+        str = str.replace(/^\s+/, "").replace(/\s+$/, "");
+        return str.split(/\s+/).join(" ");
+    },
+    
 };
 
 // hackish, but who cares?
Received on Wednesday, 2 December 2009 17:10:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 2 December 2009 17:10:12 GMT