瀏覽代碼

add: html output with script tag

wangweimin 5 年之前
父節點
當前提交
5594457527
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      pywebio/html/js/pywebio.js

+ 5 - 1
pywebio/html/js/pywebio.js

@@ -194,7 +194,11 @@
     };
 
     OutputController.prototype.get_html_element = function (spec) {
-        return $($.parseHTML(spec.content));
+        var nodes = $.parseHTML(spec.content, null, true);
+        var elem = $(nodes);
+        if (nodes.length > 1)
+            elem = $('<div><div/>').append(elem);
+        return elem;
     };
 
     OutputController.prototype.get_buttons_element = function (spec) {