mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Pick up the home page link from an Atom feed when it’s not specified as rel="alternate" — when it’s just an href. (Now we can get the favicon and feed icon properly for Allen Pike’s feed.)
This commit is contained in:
@@ -120,9 +120,19 @@ private extension AtomParser {
|
||||
guard feed.link == nil, let currentAttributes else {
|
||||
return
|
||||
}
|
||||
guard let link = currentAttributes[XMLString.href] else {
|
||||
return
|
||||
}
|
||||
|
||||
if let related = currentAttributes[XMLString.rel], related == XMLString.alternate {
|
||||
feed.link = currentAttributes[XMLString.href]
|
||||
let isRelated: Bool = {
|
||||
if let related = currentAttributes[XMLString.rel], related == XMLString.alternate { // rel="alternate"
|
||||
return true
|
||||
}
|
||||
return currentAttributes.count == 1 // Example: <link href="https://www.allenpike.com/"/> — no rel or anything
|
||||
}()
|
||||
|
||||
if isRelated {
|
||||
feed.link = link
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user