diff lib/js/urweb.js @ 2008:93ff76058825

HTML5 data-* attributes
author Adam Chlipala <adam@chlipala.net>
date Fri, 02 May 2014 15:32:10 -0400
parents 9356e8f91ea4
children 2b2d07946e65
line wrap: on
line diff
--- a/lib/js/urweb.js	Wed Apr 30 13:05:54 2014 -0400
+++ b/lib/js/urweb.js	Fri May 02 15:32:10 2014 -0400
@@ -1942,6 +1942,19 @@
 }
 
 
+// Attribute name blessing
+
+function blessData(s) {
+    for (var i = 0; i < s.length; ++i) {
+        var c = s[i];
+        if (!isAlnum(c) && c != '-' && c != '_')
+            er("Disallowed character in data-* attribute name");
+    }
+
+    return s;
+}
+
+
 // CSS validation
 
 function atom(s) {