summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2015-06-08 11:11:46 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2015-06-08 11:11:46 -0400
commit81d24bdd643e6ad7be78e69c5c0fca8c096c2c9a (patch)
tree53aabf9a2b0015c2c7f8ef2e7573b131341c0e1e
parentbc30b26207d28491b27ccc40aea7f89fd01c3571 (diff)
Apply syntax sugar for 'class' attribute to <form> as well
-rw-r--r--src/urweb.grm1
-rw-r--r--tests/classy_form.ur9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/urweb.grm b/src/urweb.grm
index 7fc34793..50dacf21 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -1624,6 +1624,7 @@ xmlOne : NOTAGS (EApp ((EVar (["Basis"], "cdata", Infer)
val e = (EVar (["Basis"], "form", Infer), pos)
val e = (EApp (e, case #2 tag of
NONE => (EVar (["Basis"], "None", Infer), pos)
+ | SOME (EPrim (Prim.String (_, s)), _) => (EApp ((EVar (["Basis"], "Some", Infer), pos), parseClass s pos), pos)
| SOME c => (EApp ((EVar (["Basis"], "Some", Infer), pos), c), pos)), pos)
in
case #3 tag of
diff --git a/tests/classy_form.ur b/tests/classy_form.ur
new file mode 100644
index 00000000..f9fafb6e
--- /dev/null
+++ b/tests/classy_form.ur
@@ -0,0 +1,9 @@
+style form_inline
+
+val main : transaction page = return <xml>
+ <body>
+ <form class="form-inline">
+ Problematic?
+ </form>
+ </body>
+</xml>