diff options
| author | Michael Skec <skec@protonmail.ch> | 2020-12-28 20:55:11 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2020-12-28 11:10:31 +0100 |
| commit | 16946275d260d4587494ac642441b1ce0eb17eed (patch) | |
| tree | f6f6fd13c6472f5b2e24749f198d3af8750fa4c8 /src/browsertab.cpp | |
| parent | 5651d53dd5e2a99e7dc1b88da7872fff4d846c4c (diff) | |
| download | kristall-16946275d260d4587494ac642441b1ce0eb17eed.tar.gz | |
Update regex for inline style stripping in HTML
Now case-insensitive, and matches styles that have attributes.
Co-authored-by: Karol Kosek <krkk@krkk.ct8.pl>
Diffstat (limited to 'src/browsertab.cpp')
| -rw-r--r-- | src/browsertab.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index 09d10b8..525a8d3 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -518,7 +518,7 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime) // Strip inline styles from page, so they don't // conflict with user styles. QString page_html = QString::fromUtf8(data); - page_html.replace(QRegularExpression("<style>([^<]*)</style>"), ""); + page_html.replace(QRegularExpression("<style.*?>[\\S\\s]*?</style.*?>", QRegularExpression::CaseInsensitiveOption), ""); document->setHtml(page_html); // Find page title in HTML |
