- From: Robin Berjon via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 02 May 2011 10:12:36 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/ReSpec.js/js
In directory hutz:/tmp/cvs-serv1420/js
Modified Files:
simple-node.js
Log Message:
sanitise generated IDs better
Index: simple-node.js
===================================================================
RCS file: /sources/public/2009/dap/ReSpec.js/js/simple-node.js,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- simple-node.js 2 May 2011 10:09:36 -0000 1.9
+++ simple-node.js 2 May 2011 10:12:34 -0000 1.10
@@ -120,8 +120,8 @@
},
sanitiseID: function (id) {
- id = id.split(/[^-.0-9a-z_]/).join("-");
- id = id.replace(/^-+/, "");
+ id = id.split(/[^-.0-9a-zA-Z_]/).join("-");
+ id = id.replace(/^-+/g, "");
id = id.replace(/-+$/, "");
if (id.length > 0 && /^[^a-z]/.test(id)) id = "x" + id;
if (id.length == 0) id = "generatedID";
Received on Monday, 2 May 2011 10:12:37 UTC