Skip to content

Commit

Permalink
feat: add support for base element when discovering feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Jul 26, 2024
1 parent 29387f2 commit f6dc952
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/reader/subscription/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ func (f *SubscriptionFinder) FindSubscriptionsFromWebPage(websiteURL, contentTyp
return nil, locale.NewLocalizedErrorWrapper(err, "error.unable_to_parse_html_document", err)
}

if hrefValue, exists := doc.Find("head base").First().Attr("href"); exists {
hrefValue = strings.TrimSpace(hrefValue)
if urllib.IsAbsoluteURL(hrefValue) {
websiteURL = hrefValue
}
}

var subscriptions Subscriptions
subscriptionURLs := make(map[string]bool)
for query, kind := range queries {
Expand Down

0 comments on commit f6dc952

Please sign in to comment.