Merge pull request #441 from vincode-io/issue-290

Don’t show author name if it’s the same as the feed name. Issue #290
This commit is contained in:
Brent Simmons 2018-09-06 15:18:40 -07:00 committed by GitHub
commit a062759126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {