Start with stopping treating QTextDocument as HTML.