Commit 298a0445 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Merge remote-tracking branch 'origin/release/20.04'

parents 2e1e7d36 752e1804
Pipeline #24332 passed with stage
in 46 minutes and 41 seconds
...@@ -40,6 +40,7 @@ void MessageViewerUtilsTest::shouldExcludeHeader_data() ...@@ -40,6 +40,7 @@ void MessageViewerUtilsTest::shouldExcludeHeader_data()
QTest::newRow("REFRESH6") << QStringLiteral("<meta content=\"0;URL=http://www.kde.org\" http-equiv= \"REFRESH\"></head>") << true; QTest::newRow("REFRESH6") << QStringLiteral("<meta content=\"0;URL=http://www.kde.org\" http-equiv= \"REFRESH\"></head>") << true;
#endif #endif
QTest::newRow("div1") << QStringLiteral("<div><p>ff</p></div></head>") << true; QTest::newRow("div1") << QStringLiteral("<div><p>ff</p></div></head>") << true;
QTest::newRow("body1") << QStringLiteral("<style>\nbody > div:nth-child(2) {\ndisplay: none !important;\n}\n</style>") << true;
} }
void MessageViewerUtilsTest::shouldExcludeHeader() void MessageViewerUtilsTest::shouldExcludeHeader()
......
...@@ -666,6 +666,10 @@ bool Util::excludeExtraHeader(const QString &s) ...@@ -666,6 +666,10 @@ bool Util::excludeExtraHeader(const QString &s)
if (s.contains(divRef)) { if (s.contains(divRef)) {
return true; return true;
} }
static QRegularExpression bodyRef(QStringLiteral("body.s*>.s*div"), QRegularExpression::CaseInsensitiveOption);
if (s.contains(bodyRef)) {
return true;
}
return false; return false;
} }
......
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