Parse html with rust
This prevents us from having to use QTextDocument to parse untrusted html emails. Resulting in crashes or worse security issues.
QTextDocument is still used in case corrosion is not found
Example of crash:
#5 0x00007f0e8a3e23f4 in QPalette::QPalette(QPalette const&) () at /lib64/libQt5Gui.so.5
#6 0x00007f0e8a4cb8ff in QTextHtmlParserNode::applyCssDeclarations(QVector<QCss::Declaration> const&, QTextDocument const*) () at /lib64/libQt5Gui.so.5
#7 0x00007f0e8a4ce2d9 in QTextHtmlParser::parseTag() () at /lib64/libQt5Gui.so.5
#8 0x00007f0e8a4ce958 in QTextHtmlParser::parse() () at /lib64/libQt5Gui.so.5
#9 0x00007f0e8a4f39a2 in QTextHtmlImporter::QTextHtmlImporter(QTextDocument*, QString const&, QTextHtmlImporter::ImportMode, QTextDocument const*) () at /lib64/libQt5Gui.so.5
#10 0x00007f0e8a4b1868 in QTextDocument::setHtml(QString const&) () at /lib64/libQt5Gui.so.5
#11 0x000000000041ec22 in EmailIndexer::processPart(KMime::Content*, KMime::Content*) (this=0xd6c030, content=0xeb7930, mainContent=0x0) at /home/carl/kde/src/akonadi-search/agent/emailindexer.cpp:251
#12 0x000000000041e6d2 in EmailIndexer::process(QSharedPointer<KMime::Message> const&) (this=0xd6c030, msg=...) at /home/carl/kde/src/akonadi-search/agent/emailindexer.cpp:226
#13 0x000000000041c8f7 in EmailIndexer::index(Akonadi::Item const&) (this=0xd6c030, item=...) at /home/carl/kde/src/akonadi-search/agent/emailindexer.cpp:81
#14 0x000000000043bc1d in Index::index(Akonadi::Item const&) (this=0x7fffea7f1418, item=...) at /home/carl/kde/src/akonadi-search/agent/index.cpp:101
Edited by Carl Schwan