mirror of
https://github.com/miniflux/v2.git
synced 2025-08-26 18:21:01 +00:00
Remove trailing space in SiteURL and FeedURL
This commit is contained in:
parent
8e28e41b02
commit
fa9697b972
7 changed files with 274 additions and 22 deletions
|
@ -24,18 +24,18 @@ func NewRDFAdapter(rdf *RDF) *RDFAdapter {
|
|||
return &RDFAdapter{rdf}
|
||||
}
|
||||
|
||||
func (r *RDFAdapter) BuildFeed(feedURL string) *model.Feed {
|
||||
func (r *RDFAdapter) BuildFeed(baseURL string) *model.Feed {
|
||||
feed := &model.Feed{
|
||||
Title: stripTags(r.rdf.Channel.Title),
|
||||
FeedURL: feedURL,
|
||||
SiteURL: r.rdf.Channel.Link,
|
||||
FeedURL: strings.TrimSpace(baseURL),
|
||||
SiteURL: strings.TrimSpace(r.rdf.Channel.Link),
|
||||
}
|
||||
|
||||
if feed.Title == "" {
|
||||
feed.Title = feedURL
|
||||
feed.Title = baseURL
|
||||
}
|
||||
|
||||
if siteURL, err := urllib.AbsoluteURL(feedURL, r.rdf.Channel.Link); err == nil {
|
||||
if siteURL, err := urllib.AbsoluteURL(feed.FeedURL, feed.SiteURL); err == nil {
|
||||
feed.SiteURL = siteURL
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue