Skip to content

Commit

Permalink
Using lxml.html.tostring's doctype argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Oct 25, 2016
1 parent 9a2551d commit 3a3cd7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nikola/nikola.py
Expand Up @@ -1348,7 +1348,7 @@ def render_template(self, template_name, output_name, context, url_type=None, is
# argument with_tail has default value True).
data = (doc.text or '').encode('utf-8') + b''.join([lxml.html.tostring(child, encoding='utf-8', method='html') for child in doc.iterchildren()])
else:
data = b'<!DOCTYPE html>\n' + lxml.html.tostring(doc, encoding='utf8', method='html', pretty_print=True)
data = lxml.html.tostring(doc, encoding='utf8', method='html', pretty_print=True, doctype='<!DOCTYPE html>')
with open(output_name, "wb+") as post_file:
post_file.write(data)

Expand Down

0 comments on commit 3a3cd7c

Please sign in to comment.