# HG changeset patch # User Adam Chlipala # Date 1326558257 18000 # Node ID d05299e561c88bd56c8a56ffcaa1e6717001a4c3 # Parent 3cfc79f92db71653cdba2ceb3a2be75bdbb5efc3 Fix bug with 'dynClass' immediately inside diff -r 3cfc79f92db7 -r d05299e561c8 lib/js/urweb.js --- a/lib/js/urweb.js Thu Jan 12 20:37:39 2012 -0500 +++ b/lib/js/urweb.js Sat Jan 14 11:24:17 2012 -0500 @@ -643,9 +643,10 @@ } function addNode(node) { - if (thisScript) - thisScript.parentNode.replaceChild(node, thisScript); - else + if (thisScript) { + if (thisScript.parentNode) + thisScript.parentNode.replaceChild(node, thisScript); + } else lastParent().appendChild(node); } diff -r 3cfc79f92db7 -r d05299e561c8 tests/doubleDyn.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/doubleDyn.ur Sat Jan 14 11:24:17 2012 -0500 @@ -0,0 +1,22 @@ +style linktitle +style topic + +fun main () : transaction page = + text <- source "Lorem ipsum dolor sit amet"; + cls <- source linktitle; + return + + Dynamic CSS class test + + + +
{[t]}
}/> +
+ +
+