aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader/atom/atom_10.go
diff options
context:
space:
mode:
Diffstat (limited to 'reader/atom/atom_10.go')
-rw-r--r--reader/atom/atom_10.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/reader/atom/atom_10.go b/reader/atom/atom_10.go
index 099cbed..708cc9f 100644
--- a/reader/atom/atom_10.go
+++ b/reader/atom/atom_10.go
@@ -84,7 +84,7 @@ func (a *atom10Entry) Transform() *model.Entry {
entry.Content = a.entryContent()
entry.Title = a.entryTitle()
entry.Enclosures = a.entryEnclosures()
- entry.CommentsURL = a.Links.firstLinkWithRelationAndType("replies", "text/html")
+ entry.CommentsURL = a.entryCommentsURL()
return entry
}
@@ -194,6 +194,15 @@ func (a *atom10Entry) entryEnclosures() model.EnclosureList {
return enclosures
}
+// See https://tools.ietf.org/html/rfc4685#section-3
+func (a *atom10Entry) entryCommentsURL() string {
+ commentsURL := a.Links.firstLinkWithRelationAndType("replies", "text/html")
+ if url.IsAbsoluteURL(commentsURL) {
+ return commentsURL
+ }
+ return ""
+}
+
type atom10Text struct {
Type string `xml:"type,attr"`
Data string `xml:",chardata"`