Added and corrected comments
This commit is contained in:
@@ -12,6 +12,8 @@ type InlineXHTMLContent struct {
|
||||
XHTMLDiv string `xml:"xhtmldiv"`
|
||||
}
|
||||
|
||||
// newInlineXHTMLContent creates a new InlineXHTMLContent. It returns a
|
||||
// *InlineXHTMLContent and an error.
|
||||
func newInlineXHTMLContent(mediaType string, content any) (*InlineXHTMLContent, error) {
|
||||
if mediaType != "xhtml" {
|
||||
return nil, fmt.Errorf("media type %v incompatible with inline xhtml content", mediaType)
|
||||
@@ -24,12 +26,19 @@ func newInlineXHTMLContent(mediaType string, content any) (*InlineXHTMLContent,
|
||||
return &InlineXHTMLContent{Type: mediaType, XHTMLDiv: content.(string)}, nil
|
||||
}
|
||||
|
||||
// isContent checks whether the InlineXHTMLContent is a Content. It returns a
|
||||
// bool.
|
||||
func (i *InlineXHTMLContent) isContent() bool { return true }
|
||||
|
||||
// hasSRC checks whether the InlineXHTMLContent has a SRC attribute. It returns
|
||||
// a bool.
|
||||
func (i *InlineXHTMLContent) hasSRC() bool { return false }
|
||||
|
||||
// getType returns the Type of the InlineXHTMLContent as a string.
|
||||
func (i *InlineXHTMLContent) getType() string { return i.Type }
|
||||
|
||||
// Check checks the InlineXHTMLContent for incompatibilities with RFC4287. It
|
||||
// returns an error.
|
||||
func (i *InlineXHTMLContent) Check() error {
|
||||
if i.Type != "xhtml" {
|
||||
return errors.New("type attribute of inline xhtml content must be xhtml")
|
||||
|
Reference in New Issue
Block a user