# HG changeset patch # User Adam Chlipala # Date 1249585064 14400 # Node ID 63114a2e507579919cc3ea43da7d12e3e188f291 # Parent 4b9f1de2c647db18f58a51690e12d0e1fb735174 inside diff -r 4b9f1de2c647 -r 63114a2e5075 lib/js/urweb.js --- a/lib/js/urweb.js Thu Aug 06 14:39:03 2009 -0400 +++ b/lib/js/urweb.js Thu Aug 06 14:57:44 2009 -0400 @@ -302,8 +302,6 @@ var dummy = document.createElement("body"); dummy.innerHTML = "" + html + "
"; runScripts(dummy); - var rows = dummy.firstChild.rows; - var nRows = rows.length; var table = x.parentNode; var arr = dummy.getElementsByTagName("tbody"); @@ -317,6 +315,23 @@ table.insertBefore(node, x); } } + } else if (pnode == "tr") { + var dummy = document.createElement("body"); + dummy.innerHTML = "" + html + "
"; + runScripts(dummy); + var table = x.parentNode; + + var arr = dummy.getElementsByTagName("tr"); + firstChild = null; + if (arr.length > 0) { + var tbody = arr[0], next; + firstChild = document.createElement("script"); + table.insertBefore(firstChild, x); + for (var node = tbody.firstChild; node; node = next) { + next = node.nextSibling; + table.insertBefore(node, x); + } + } } else { firstChild = document.createElement("span"); firstChild.innerHTML = html; diff -r 4b9f1de2c647 -r 63114a2e5075 src/monoize.sml --- a/src/monoize.sml Thu Aug 06 14:39:03 2009 -0400 +++ b/src/monoize.sml Thu Aug 06 14:57:44 2009 -0400 @@ -2645,13 +2645,15 @@ | "dyn" => let - val inTable = case targs of - (L.CRecord (_, ctx), _) :: _ => - List.exists (fn ((L.CName "Table", _), _) => true - | _ => false) ctx - | _ => false + fun inTag tag = case targs of + (L.CRecord (_, ctx), _) :: _ => + List.exists (fn ((L.CName tag', _), _) => tag' = tag + | _ => false) ctx + | _ => false - val tag = if inTable then + val tag = if inTag "Tr" then + "tr" + else if inTag "Table" then "table" else "span" diff -r 4b9f1de2c647 -r 63114a2e5075 tests/dcol.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/dcol.ur Thu Aug 06 14:57:44 2009 -0400 @@ -0,0 +1,8 @@ +fun main () = + s <- source AA'; + return +