Revert "WIP: Title tags"

This commit is contained in:
Maurice Parker
2020-04-24 20:24:24 -05:00
committed by GitHub
parent 8b584d0000
commit 86fb98c17b
14 changed files with 20 additions and 299 deletions

View File

@@ -52,8 +52,8 @@ struct ArticleStringFormatter {
return s
}
static func truncatedTitle(_ article: Article, forHTML: Bool = false) -> String {
guard let title = article.sanitizedTitle(forHTML: forHTML) else {
static func truncatedTitle(_ article: Article) -> String {
guard let title = article.title else {
return ""
}
@@ -64,11 +64,7 @@ struct ArticleStringFormatter {
var s = title.replacingOccurrences(of: "\n", with: "")
s = s.replacingOccurrences(of: "\r", with: "")
s = s.replacingOccurrences(of: "\t", with: "")
if !forHTML {
s = s.rsparser_stringByDecodingHTMLEntities()
}
s = s.rsparser_stringByDecodingHTMLEntities()
s = s.trimmingWhitespace
s = s.collapsingWhitespace
@@ -83,12 +79,6 @@ struct ArticleStringFormatter {
return s
}
static func attributedTruncatedTitle(_ article: Article) -> NSAttributedString {
let title = truncatedTitle(article, forHTML: true)
let attributed = NSAttributedString(html: title)
return attributed
}
static func truncatedSummary(_ article: Article) -> String {
guard let body = article.body else {
return ""