diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-01-22 20:25:14 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-01-22 20:25:14 -0500 |
commit | 912c6fcf0c09348965262dd13c8faaefa61c2999 (patch) | |
tree | 95c82a3c6cb68f2d41b337a3c9158faaa06e8c0d | |
parent | 13f7571727ad5626070ad9b735582d15e51161c4 (diff) |
Fix runtime system handling of <dyn> inside <table> inside <dyn>
-rw-r--r-- | lib/js/urweb.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index adab5f43..b557147b 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -699,10 +699,15 @@ function normalizeTable(table) { for (var tbody = table.firstChild; tbody; tbody = tbody.nextSibling) { if (tbody.tagName == "TBODY") { + var firstChild = tbody.firstChild; + for (script = table.firstChild; script && script != tbody; script = next) { next = script.nextSibling; - tbody.insertBefore(script, tbody.firstChild); + if (firstChild) + tbody.insertBefore(script, firstChild); + else + tbody.appendChild(script); } return; @@ -713,7 +718,7 @@ function normalizeTable(table) { for (script = table.firstChild; script; script = next) { next = script.nextSibling; - tbody.insertBefore(script, tbody.firstChild); + tbody.appendChild(script); } table.appendChild(tbody); } |