Commit dfbd6e36 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

insert style on body.

parent aef25d7f
...@@ -67,7 +67,7 @@ void WebEnginePartHtmlWriter::end() ...@@ -67,7 +67,7 @@ void WebEnginePartHtmlWriter::end()
mExtraHead.clear(); mExtraHead.clear();
} }
if (!mStyleBody.isEmpty()) { if (!mStyleBody.isEmpty()) {
//insertBodyStyle(); insertBodyStyle();
mStyleBody.clear(); mStyleBody.clear();
} }
// see QWebEnginePage::setHtml() // see QWebEnginePage::setHtml()
......
...@@ -169,7 +169,7 @@ void MessageViewerUtilsTest::shouldExtractBodyStyle_data() ...@@ -169,7 +169,7 @@ void MessageViewerUtilsTest::shouldExtractBodyStyle_data()
QTest::addColumn<QString>("output"); QTest::addColumn<QString>("output");
QTest::newRow("empty") << QString() << QString(); QTest::newRow("empty") << QString() << QString();
QTest::newRow("test1") << QStringLiteral("<body style=\"overflow-wrap:break-word; word-break: break-word;white-space:pre-wrap;\">") QTest::newRow("test1") << QStringLiteral("<body style=\"overflow-wrap:break-word; word-break: break-word;white-space:pre-wrap;\">")
<< QStringLiteral(" style=\"white-space:pre-wrap;\""); << QStringLiteral(" style=\"overflow-wrap:break-word;word-break: break-word;\"");
} }
void MessageViewerUtilsTest::shouldExtractHtmlBenchmark() void MessageViewerUtilsTest::shouldExtractHtmlBenchmark()
......
...@@ -703,7 +703,7 @@ QString Util::parseBodyStyle(const QString &style) ...@@ -703,7 +703,7 @@ QString Util::parseBodyStyle(const QString &style)
#endif #endif
QStringList lst; QStringList lst;
for (const auto &style : lstStyle) { for (const auto &style : lstStyle) {
if (style.trimmed().contains(QLatin1String("white-space"))) { if (!style.trimmed().contains(QLatin1String("white-space"))) {
lst.append(style.toString().trimmed()); lst.append(style.toString().trimmed());
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment