This commit is contained in:
Martin Rotter 2022-09-07 07:08:49 +02:00
parent a23a1a88a6
commit 4af15a8c88
5 changed files with 11 additions and 4 deletions

View File

@ -24,7 +24,7 @@
<url type="donation">https://github.com/sponsors/martinrotter</url> <url type="donation">https://github.com/sponsors/martinrotter</url>
<content_rating type="oars-1.1" /> <content_rating type="oars-1.1" />
<releases> <releases>
<release version="4.2.4" date="2022-09-06"/> <release version="4.2.4" date="2022-09-07"/>
</releases> </releases>
<content_rating type="oars-1.0"> <content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute> <content_attribute id="violence-cartoon">none</content_attribute>

View File

@ -46,7 +46,7 @@ I highly recommend to download RSS Guard only from reputable sources.
## Supported Operating Systems <a id="sos"></a> ## Supported Operating Systems <a id="sos"></a>
RSS Guard is a cross-platform application, and at this point it is known to work on: RSS Guard is a cross-platform application, and at this point it is known to work on:
* Windows 7+ * 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.) * BSD (FreeBSD, OpenBSD, NetBSD, etc.)
* macOS 10.13+ * macOS 10.13+
* OS/2 (ArcaOS, eComStation) * OS/2 (ArcaOS, eComStation)

View File

@ -139,7 +139,7 @@ QPair<QString, QUrl> SkinFactory::generateHtmlOfArticles(const QList<Message>& m
for (const Message& message : messages) { for (const Message& message : messages) {
QString enclosures; QString enclosures;
QString enclosure_images; 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) { for (const Enclosure& enclosure : message.m_enclosures) {
QString enc_url = QUrl::fromPercentEncoding(enclosure.m_url.toUtf8()); QString enc_url = QUrl::fromPercentEncoding(enclosure.m_url.toUtf8());

View File

@ -63,6 +63,12 @@ int TextFactory::stringWidth(const QString& string, const QFontMetrics& metrics)
return width; return width;
} }
bool TextFactory::couldBeHtml(const QString& string) {
const QString sstring = string.simplified();
return sstring.startsWith(QL1S("<!")) || Qt::mightBeRichText(sstring);
}
QDateTime TextFactory::parseDateTime(const QString& date_time) { QDateTime TextFactory::parseDateTime(const QString& date_time) {
const QString input_date = date_time.simplified(); const QString input_date = date_time.simplified();
QDateTime dt; QDateTime dt;

View File

@ -10,7 +10,6 @@
class TextFactory { class TextFactory {
private: private:
// Constructors and destructors. // Constructors and destructors.
TextFactory(); TextFactory();
@ -20,6 +19,8 @@ class TextFactory {
static int stringHeight(const QString& string, const QFontMetrics& metrics); static int stringHeight(const QString& string, const QFontMetrics& metrics);
static int stringWidth(const QString& string, const QFontMetrics& metrics); static int stringWidth(const QString& string, const QFontMetrics& metrics);
static bool couldBeHtml(const QString& string);
// Tries to parse input textual date/time representation. // Tries to parse input textual date/time representation.
// Returns invalid date/time if processing fails. // Returns invalid date/time if processing fails.
// NOTE: This method tries to always return time in UTC. // NOTE: This method tries to always return time in UTC.