diff --git a/internal/reader/opml/opml.go b/internal/reader/opml/opml.go index 2f7147a0..8fe3af09 100644 --- a/internal/reader/opml/opml.go +++ b/internal/reader/opml/opml.go @@ -34,6 +34,23 @@ type opmlOutline struct { Outlines opmlOutlineCollection `xml:"outline,omitempty"` } +func (outline opmlOutline) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + type opmlOutlineXml opmlOutline + + outlineType := "" + if outline.IsSubscription() { + outlineType = "rss" + } + + return e.EncodeElement(struct { + opmlOutlineXml + Type string `xml:"type,attr,omitempty"` + }{ + opmlOutlineXml: opmlOutlineXml(outline), + Type: outlineType, + }, start) +} + func (o *opmlOutline) IsSubscription() bool { return strings.TrimSpace(o.FeedURL) != "" }