From 4af15a8c88785fb45f365a5f3a8a5aad2093e65b Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Wed, 7 Sep 2022 07:08:49 +0200 Subject: [PATCH] fix #792 --- resources/desktop/com.github.rssguard.appdata.xml | 2 +- resources/docs/Documentation.md | 2 +- src/librssguard/miscellaneous/skinfactory.cpp | 2 +- src/librssguard/miscellaneous/textfactory.cpp | 6 ++++++ src/librssguard/miscellaneous/textfactory.h | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index 757c94ea9..5f7d70973 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -24,7 +24,7 @@ https://github.com/sponsors/martinrotter - + none diff --git a/resources/docs/Documentation.md b/resources/docs/Documentation.md index 98fb648e7..313f0ee7e 100644 --- a/resources/docs/Documentation.md +++ b/resources/docs/Documentation.md @@ -46,7 +46,7 @@ I highly recommend to download RSS Guard only from reputable sources. ## Supported Operating Systems RSS Guard is a cross-platform application, and at this point it is known to work on: * Windows 7+ -* GNU/Linux (including PinePhone and other Linux-based phone operating systems) +* GNU/Linux with glibc 2.31+ (including PinePhone and other Linux-based phone operating systems) * BSD (FreeBSD, OpenBSD, NetBSD, etc.) * macOS 10.13+ * OS/2 (ArcaOS, eComStation) diff --git a/src/librssguard/miscellaneous/skinfactory.cpp b/src/librssguard/miscellaneous/skinfactory.cpp index 5ca1a3a5c..fd2237852 100644 --- a/src/librssguard/miscellaneous/skinfactory.cpp +++ b/src/librssguard/miscellaneous/skinfactory.cpp @@ -139,7 +139,7 @@ QPair SkinFactory::generateHtmlOfArticles(const QList& m for (const Message& message : messages) { QString enclosures; QString enclosure_images; - bool is_plain = !Qt::mightBeRichText(message.m_contents.simplified()); + bool is_plain = !TextFactory::couldBeHtml(message.m_contents); for (const Enclosure& enclosure : message.m_enclosures) { QString enc_url = QUrl::fromPercentEncoding(enclosure.m_url.toUtf8()); diff --git a/src/librssguard/miscellaneous/textfactory.cpp b/src/librssguard/miscellaneous/textfactory.cpp index 061968a19..3567764f2 100644 --- a/src/librssguard/miscellaneous/textfactory.cpp +++ b/src/librssguard/miscellaneous/textfactory.cpp @@ -63,6 +63,12 @@ int TextFactory::stringWidth(const QString& string, const QFontMetrics& metrics) return width; } +bool TextFactory::couldBeHtml(const QString& string) { + const QString sstring = string.simplified(); + + return sstring.startsWith(QL1S("