From 26e0c99150b9225c766e7baefe76649447a1142c Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Thu, 17 Oct 2024 19:44:27 +0200 Subject: [PATCH] Use *XHTMLDiv --- inlineXHTMLContent.go | 4 ++-- text.go | 2 +- xhtmlText.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inlineXHTMLContent.go b/inlineXHTMLContent.go index 6202681..0aae65e 100644 --- a/inlineXHTMLContent.go +++ b/inlineXHTMLContent.go @@ -7,8 +7,8 @@ import ( type InlineXHTMLContent struct { *CommonAttributes + XHTMLDiv *XHTMLDiv Type string `xml:"type,attr"` - XHTMLDiv XHTMLDiv } // newInlineXHTMLContent creates a new InlineXHTMLContent. It returns a @@ -18,7 +18,7 @@ func newInlineXHTMLContent(mediaType string, content any) (*InlineXHTMLContent, return nil, fmt.Errorf("media type %v incompatible with inline xhtml content", mediaType) } - xhtmlDiv, ok := content.(XHTMLDiv) + xhtmlDiv, ok := content.(*XHTMLDiv) if !ok { return nil, fmt.Errorf("content type %T incompatible with inline xhtml content", content) } diff --git a/text.go b/text.go index 97dded5..d69f1af 100644 --- a/text.go +++ b/text.go @@ -20,7 +20,7 @@ func NewText(textType, content string) (Text, error) { case "xhtml": return &XHTMLText{ Type: textType, - XHTMLDiv: XHTMLDiv{ + XHTMLDiv: &XHTMLDiv{ XMLNS: "http://www.w3.org/1999/xhtml", Content: content, }, diff --git a/xhtmlText.go b/xhtmlText.go index 1deeeb1..17f9680 100644 --- a/xhtmlText.go +++ b/xhtmlText.go @@ -7,8 +7,8 @@ import ( type XHTMLText struct { *CommonAttributes + XHTMLDiv *XHTMLDiv Type string `xml:"type,attr"` // Must be xhtml - XHTMLDiv XHTMLDiv } // isText checks whether the XHTMLText is a Text. It returns a bool.