Don’t show author name if it’s the same as the feed name. Issue #290

This commit is contained in:
Maurice Parker 2018-09-06 17:09:11 -05:00
parent 48b859fbd2
commit 1b477a4e31
1 changed files with 11 additions and 2 deletions

View File

@ -400,7 +400,16 @@ class ArticleRenderer {
return "" return ""
} }
var byline = "" // If the author's name is the same as the feed, then we don't want to display it.
// This code assumes that multiple authors would never match the feed name so that
// if there feed owner has an article co-author all authors are given the byline.
if authors.count == 1, let author = authors.first {
if author.name == article.feed?.nameForDisplay {
return ""
}
}
var byline = ""
var isFirstAuthor = true var isFirstAuthor = true
for author in authors { for author in authors {
@ -430,8 +439,8 @@ class ArticleRenderer {
} }
} }
return byline return byline
} }
private func renderedHTML() -> String { private func renderedHTML() -> String {