Just moving code around, no change

This commit is contained in:
Jason Streifling 2024-10-15 20:52:35 +02:00
parent 31b6e51cb8
commit d96e2c61bb

View File

@ -12,12 +12,6 @@ type InlineTextContent struct {
Texts []string `xml:"texts,omitempty"`
}
func (i *InlineTextContent) isContent() bool { return true }
func (i *InlineTextContent) hasSRC() bool { return false }
func (i *InlineTextContent) getType() string { return i.Type }
func newInlineTextContent(mediaType string, content any) (*InlineTextContent, error) {
if mediaType != "text" && mediaType != "html" && mediaType != "" {
return nil, fmt.Errorf("media type %v incompatible with inline text content", mediaType)
@ -42,6 +36,12 @@ func newInlineTextContent(mediaType string, content any) (*InlineTextContent, er
return &InlineTextContent{Type: mediaType, Texts: texts}, nil
}
func (i *InlineTextContent) isContent() bool { return true }
func (i *InlineTextContent) hasSRC() bool { return false }
func (i *InlineTextContent) getType() string { return i.Type }
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")