diff options
author | Adam Chlipala <adam@chlipala.net> | 2014-04-21 12:09:58 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2014-04-21 12:09:58 -0400 |
commit | c3d2041bb380b3a576564419fc9a9386a98e75b7 (patch) | |
tree | 4371c9a659e2c168f1c573831e9ebe42a4fd7397 /lib | |
parent | 052a3c80512fd8c99163f921d53b51800c402ff6 (diff) |
Change <active> to avoid generating an empty <span> for empty content
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 2e350378..fe628130 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -1009,8 +1009,6 @@ function active(s) { if (suspendScripts) return; - var span = document.createElement("span"); - addNode(span); var ms = maySuspend; maySuspend = false; try { @@ -1020,7 +1018,11 @@ function active(s) { throw e; } maySuspend = ms; - setInnerHTML(span, html); + if (html != "") { + var span = document.createElement("span"); + addNode(span); + setInnerHTML(span, html); + } } function input(x, s, recreate, type, name) { |