fix #792
This commit is contained in:
parent
a23a1a88a6
commit
4af15a8c88
@ -24,7 +24,7 @@
|
||||
<url type="donation">https://github.com/sponsors/martinrotter</url>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="4.2.4" date="2022-09-06"/>
|
||||
<release version="4.2.4" date="2022-09-07"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||
|
@ -46,7 +46,7 @@ I highly recommend to download RSS Guard only from reputable sources.
|
||||
## Supported Operating Systems <a id="sos"></a>
|
||||
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)
|
||||
|
@ -139,7 +139,7 @@ QPair<QString, QUrl> SkinFactory::generateHtmlOfArticles(const QList<Message>& 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());
|
||||
|
@ -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("<!")) || Qt::mightBeRichText(sstring);
|
||||
}
|
||||
|
||||
QDateTime TextFactory::parseDateTime(const QString& date_time) {
|
||||
const QString input_date = date_time.simplified();
|
||||
QDateTime dt;
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
class TextFactory {
|
||||
private:
|
||||
|
||||
// Constructors and destructors.
|
||||
TextFactory();
|
||||
|
||||
@ -20,6 +19,8 @@ class TextFactory {
|
||||
static int stringHeight(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.
|
||||
// Returns invalid date/time if processing fails.
|
||||
// NOTE: This method tries to always return time in UTC.
|
||||
|
Loading…
x
Reference in New Issue
Block a user