Skip to content
Permalink
Browse files

Using lxml.html.tostring's doctype argument.

  • Loading branch information
felixfontein committed Oct 25, 2016
1 parent 9a2551d commit 3a3cd7c06c87201d36fd8ed75c02e734f947a50b
Showing with 1 addition and 1 deletion.
  1. +1 −1 nikola/nikola.py
@@ -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)

0 comments on commit 3a3cd7c

Please sign in to comment.
You can’t perform that action at this time.