aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-07 09:29:25 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-09 19:44:36 -1000
commitf13fbed3ce0247e55561b3dbe35819c672958cd7 (patch)
tree507b07dff94ef247277266cf96f45d3cfe587e01 /lib
parent83c447c64b6339b9b2b98e3e35d22d2ef95ea611 (diff)
downloadpatchfoo-f13fbed3ce0247e55561b3dbe35819c672958cd7.tar.gz
patchfoo-f13fbed3ce0247e55561b3dbe35819c672958cd7.zip
Add back doctype
Diffstat (limited to 'lib')
-rw-r--r--lib/util.js4
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) {