Discard the email address in the byline if it is a no reply. Issue #2351
This commit is contained in:
parent
d98608fe3a
commit
1cda2ac3be
|
@ -218,19 +218,24 @@ private extension ArticleRenderer {
|
|||
}
|
||||
isFirstAuthor = false
|
||||
|
||||
if let emailAddress = author.emailAddress, emailAddress.contains(" ") {
|
||||
var authorEmailAddress: String? = nil
|
||||
if let emailAddress = author.emailAddress, !(emailAddress.contains("noreply@") || emailAddress.contains("no-reply@")) {
|
||||
authorEmailAddress = emailAddress
|
||||
}
|
||||
|
||||
if let emailAddress = authorEmailAddress, emailAddress.contains(" ") {
|
||||
byline += emailAddress // probably name plus email address
|
||||
}
|
||||
else if let name = author.name, let url = author.url {
|
||||
byline += name.htmlByAddingLink(url)
|
||||
}
|
||||
else if let name = author.name, let emailAddress = author.emailAddress {
|
||||
else if let name = author.name, let emailAddress = authorEmailAddress {
|
||||
byline += "\(name) <\(emailAddress)>"
|
||||
}
|
||||
else if let name = author.name {
|
||||
byline += name
|
||||
}
|
||||
else if let emailAddress = author.emailAddress {
|
||||
else if let emailAddress = authorEmailAddress {
|
||||
byline += "<\(emailAddress)>" // TODO: mailto link
|
||||
}
|
||||
else if let url = author.url {
|
||||
|
|
|
@ -134,17 +134,22 @@ extension Article {
|
|||
byline += ", "
|
||||
}
|
||||
isFirstAuthor = false
|
||||
|
||||
var authorEmailAddress: String? = nil
|
||||
if let emailAddress = author.emailAddress, !(emailAddress.contains("noreply@") || emailAddress.contains("no-reply@")) {
|
||||
authorEmailAddress = emailAddress
|
||||
}
|
||||
|
||||
if let emailAddress = author.emailAddress, emailAddress.contains(" ") {
|
||||
if let emailAddress = authorEmailAddress, emailAddress.contains(" ") {
|
||||
byline += emailAddress // probably name plus email address
|
||||
}
|
||||
else if let name = author.name, let emailAddress = author.emailAddress {
|
||||
else if let name = author.name, let emailAddress = authorEmailAddress {
|
||||
byline += "\(name) <\(emailAddress)>"
|
||||
}
|
||||
else if let name = author.name {
|
||||
byline += name
|
||||
}
|
||||
else if let emailAddress = author.emailAddress {
|
||||
else if let emailAddress = authorEmailAddress {
|
||||
byline += "<\(emailAddress)>"
|
||||
}
|
||||
else if let url = author.url {
|
||||
|
|
Loading…
Reference in New Issue