aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/js/urweb.js2
-rw-r--r--tests/a_case_of_the_splits.ur17
-rw-r--r--tests/a_case_of_the_splits.urp4
3 files changed, 22 insertions, 1 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 199f5001..bf20cfd4 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -1439,7 +1439,7 @@ function eh(x) {
if (x == null)
return "NULL";
else
- return x.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
+ return flattenLocal(x).split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
function ts(x) { return x.toString() }
diff --git a/tests/a_case_of_the_splits.ur b/tests/a_case_of_the_splits.ur
new file mode 100644
index 00000000..2029729e
--- /dev/null
+++ b/tests/a_case_of_the_splits.ur
@@ -0,0 +1,17 @@
+fun newCounter () : transaction xbody =
+ x <- source 0;
+ return <xml>
+ <dyn signal={n <- signal x; return <xml>{[n]}</xml>}/>
+ </xml>
+
+fun main () : transaction page =
+ ls <- source ([] : list xbody);
+ return <xml>
+ <body>
+ <button value="Add" onclick={fn _ =>
+ l <- get ls;
+ c <- newCounter ();
+ set ls (c :: l)}/>
+ <dyn signal={l <- signal ls; return <xml>{[l]}</xml>}/>
+ </body>
+ </xml>
diff --git a/tests/a_case_of_the_splits.urp b/tests/a_case_of_the_splits.urp
new file mode 100644
index 00000000..b8238bf4
--- /dev/null
+++ b/tests/a_case_of_the_splits.urp
@@ -0,0 +1,4 @@
+rewrite all A_case_of_the_splits/*
+
+$/list
+a_case_of_the_splits