BugFix (MD): Fix a bug introduced in c6e0c4c8fdebd which distorted the html output.

The lxml.etree.tostring method converts elements with no content into the
<tag /> form, which is valid xml but invalid html and causes the resulting
html to be parsed incorrectly. One needs to supply the method='html'
optional parameter.
Merge commit 'e4d83d02495747c8fb7671e58e7db038a42cd4b0'