Fix stripping of doctype declaration

This commit is contained in:
atomiks
2018-02-28 18:14:41 +10:00
parent 76f6f4f48a
commit 506a73f175
4 changed files with 21 additions and 13 deletions

View File

@ -67,4 +67,10 @@ for (const snippetFile of fs.readdirSync(SNIPPETS_PATH)) {
)
}
fs.writeFileSync('./index.html', pretty(document.documentElement.outerHTML, { ocd: true }))
// doctype declaration gets stripped, add it back in
const html = `
<!DOCTYPE html>
${pretty(document.documentElement.outerHTML, { ocd: true })}
`
fs.writeFileSync('./index.html', html)