package atom const ( InlineText = iota InlineXHTML InlineOther OutOfLine ) type Content interface { isContent() bool hasSRC() bool getType() string Check() error } // NewContent creates a new Content. It takes in an int contentType, a string // mediaType and an any content and returns a Content. // // If contentType is invalid, it returns nil. func NewContent(contentType int, mediaType string, content any) Content { switch contentType { case 0: return newInlineTextContent(mediaType, content.(string)) case 1: return newInlineXHTMLContent(mediaType, content.(*XHTMLDiv)) case 2: return newInlineOtherContent(mediaType, content) case 3: return newOutOfLineContent(mediaType, content.(string)) default: return nil } }