diff options
Diffstat (limited to 'lib/util.js')
-rw-r--r-- | lib/util.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/util.js b/lib/util.js index 6a419f9..fe5b4f3 100644 --- a/lib/util.js +++ b/lib/util.js @@ -38,7 +38,9 @@ u.toHTML = function (el) { if (typeof el === 'string' || Array.isArray(el)) { return h('div', el).innerHTML } - return el.outerHTML || String(el) + var html = el.outerHTML || String(el) + if (el.nodeName === 'html') html = '<!doctype html>' + html + '\n' + return html } u.hyperwrap = function (fn) { |