First implementation of an atom feed

This commit is contained in:
2024-10-13 17:19:40 +02:00
parent 520c2de196
commit 92c794d070
23 changed files with 805 additions and 0 deletions

23
xhtmlText.go Normal file
View File

@@ -0,0 +1,23 @@
package atomfeed
import "errors"
type XHTMLText struct {
*CommonAttributes
Type string `xml:"type,attr"` // Must be xhtml
XHTMLDiv string `xml:"div"`
}
func (x *XHTMLText) IsText() bool { return true }
func (x *XHTMLText) Check() error {
if x.Type != "xhtml" {
return errors.New("type attribute of xhtml text must be xhtml")
}
if x.XHTMLDiv == "" {
return errors.New("xhtmlDiv element of xhtml text empty")
}
return nil
}