Use *XHTMLDiv
This commit is contained in:
parent
6117876a59
commit
26e0c99150
@ -7,8 +7,8 @@ import (
|
|||||||
|
|
||||||
type InlineXHTMLContent struct {
|
type InlineXHTMLContent struct {
|
||||||
*CommonAttributes
|
*CommonAttributes
|
||||||
|
XHTMLDiv *XHTMLDiv
|
||||||
Type string `xml:"type,attr"`
|
Type string `xml:"type,attr"`
|
||||||
XHTMLDiv XHTMLDiv
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// newInlineXHTMLContent creates a new InlineXHTMLContent. It returns a
|
// 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)
|
return nil, fmt.Errorf("media type %v incompatible with inline xhtml content", mediaType)
|
||||||
}
|
}
|
||||||
|
|
||||||
xhtmlDiv, ok := content.(XHTMLDiv)
|
xhtmlDiv, ok := content.(*XHTMLDiv)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("content type %T incompatible with inline xhtml content", content)
|
return nil, fmt.Errorf("content type %T incompatible with inline xhtml content", content)
|
||||||
}
|
}
|
||||||
|
2
text.go
2
text.go
@ -20,7 +20,7 @@ func NewText(textType, content string) (Text, error) {
|
|||||||
case "xhtml":
|
case "xhtml":
|
||||||
return &XHTMLText{
|
return &XHTMLText{
|
||||||
Type: textType,
|
Type: textType,
|
||||||
XHTMLDiv: XHTMLDiv{
|
XHTMLDiv: &XHTMLDiv{
|
||||||
XMLNS: "http://www.w3.org/1999/xhtml",
|
XMLNS: "http://www.w3.org/1999/xhtml",
|
||||||
Content: content,
|
Content: content,
|
||||||
},
|
},
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
|
|
||||||
type XHTMLText struct {
|
type XHTMLText struct {
|
||||||
*CommonAttributes
|
*CommonAttributes
|
||||||
|
XHTMLDiv *XHTMLDiv
|
||||||
Type string `xml:"type,attr"` // Must be xhtml
|
Type string `xml:"type,attr"` // Must be xhtml
|
||||||
XHTMLDiv XHTMLDiv
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// isText checks whether the XHTMLText is a Text. It returns a bool.
|
// isText checks whether the XHTMLText is a Text. It returns a bool.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user