atom/inlineTextContent.go

20 lines
477 B
Go
Raw Normal View History

2024-10-13 17:19:40 +02:00
package atomfeed
import "errors"
type InlineTextContent struct {
*CommonAttributes
Type string `xml:"type,attr,omitempty"` // Must be text or html
Texts []string `xml:"texts,omitempty"`
}
func (i *InlineTextContent) IsContent() bool { return true }
func (i *InlineTextContent) Check() error {
if i.Type != "" && i.Type != "text" && i.Type != "html" {
return errors.New("type attribute of inline text content must be text or html if not omitted")
}
return nil
}