comparison 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
comparison
equal deleted inserted replaced
2007:d3a0f2b8af28 2008:93ff76058825
1940 er("Disallowed URL: " + s); 1940 er("Disallowed URL: " + s);
1941 return u; 1941 return u;
1942 } 1942 }
1943 1943
1944 1944
1945 // Attribute name blessing
1946
1947 function blessData(s) {
1948 for (var i = 0; i < s.length; ++i) {
1949 var c = s[i];
1950 if (!isAlnum(c) && c != '-' && c != '_')
1951 er("Disallowed character in data-* attribute name");
1952 }
1953
1954 return s;
1955 }
1956
1957
1945 // CSS validation 1958 // CSS validation
1946 1959
1947 function atom(s) { 1960 function atom(s) {
1948 for (var i = 0; i < s.length; ++i) { 1961 for (var i = 0; i < s.length; ++i) {
1949 var c = s[i]; 1962 var c = s[i];