diff --git a/Mac/MainWindow/Timeline/Cell/TimelineCellData.swift b/Mac/MainWindow/Timeline/Cell/TimelineCellData.swift index 1e92a7714..53bb79adb 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineCellData.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineCellData.swift @@ -11,6 +11,8 @@ import Articles struct TimelineCellData { + private static let noText = NSLocalizedString("(No Text)", comment: "No Text") + let title: String let attributedTitle: NSAttributedString let text: String @@ -28,8 +30,14 @@ struct TimelineCellData { self.title = ArticleStringFormatter.truncatedTitle(article) self.attributedTitle = ArticleStringFormatter.attributedTruncatedTitle(article) - self.text = ArticleStringFormatter.truncatedSummary(article) + let truncatedSummary = ArticleStringFormatter.truncatedSummary(article) + if self.title.isEmpty && truncatedSummary.isEmpty { + self.text = Self.noText + } else { + self.text = truncatedSummary + } + self.dateString = ArticleStringFormatter.dateString(article.logicalDatePublished) if let feedName = feedName { diff --git a/iOS/MasterTimeline/Cell/MasterTimelineCellData.swift b/iOS/MasterTimeline/Cell/MasterTimelineCellData.swift index d1d1c3782..2c3c8b822 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineCellData.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineCellData.swift @@ -10,6 +10,8 @@ import UIKit import Articles struct MasterTimelineCellData { + + private static let noText = NSLocalizedString("(No Text)", comment: "No Text") let title: String let attributedTitle: NSAttributedString @@ -30,8 +32,14 @@ struct MasterTimelineCellData { self.title = ArticleStringFormatter.truncatedTitle(article) self.attributedTitle = ArticleStringFormatter.attributedTruncatedTitle(article) - self.summary = ArticleStringFormatter.truncatedSummary(article) + let truncatedSummary = ArticleStringFormatter.truncatedSummary(article) + if self.title.isEmpty && truncatedSummary.isEmpty { + self.summary = Self.noText + } else { + self.summary = truncatedSummary + } + self.dateString = ArticleStringFormatter.dateString(article.logicalDatePublished) if let feedName = feedName {