@DiapDealer, can you change the line ~45 in smarten.py to the one below (it adds flags) and try it again on the multiline DOCTYPE
the line follows the comment:
# Split the html into tags and text
Code:
entities = re.split(r'(<.+?>)', text, flags=re.M|re.S)
It would then allow multiline tags, rather than single lined ones, should also help catch a few other possible odd ones.
Thanks.