diff src/c/urweb.c @ 2008:93ff76058825

HTML5 data-* attributes
author Adam Chlipala <adam@chlipala.net>
date Fri, 02 May 2014 15:32:10 -0400
parents 16f5f136a807
children 77cc9169d6e0
line wrap: on
line diff
--- a/src/c/urweb.c	Wed Apr 30 13:05:54 2014 -0400
+++ b/src/c/urweb.c	Fri May 02 15:32:10 2014 -0400
@@ -4396,3 +4396,13 @@
 
   return f;
 }
+
+uw_Basis_string uw_Basis_blessData(uw_context ctx, uw_Basis_string s) {
+  char *p = s;
+
+  for (; *p; ++p)
+    if (!isalnum(*p) && *p != '-' && *p != '_')
+      uw_error(ctx, FATAL, "Illegal HTML5 data-* attribute: %s", s);
+
+  return s;
+}