1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-08 17:20:26 +08:00

add more attrs

This commit is contained in:
源文雨
2023-03-06 15:35:46 +08:00
parent e3d6e419d5
commit 32cb2064cd
6 changed files with 136 additions and 13 deletions

View File

@@ -70,6 +70,22 @@ func (c *WordprocessingCanvas) UnmarshalXML(d *xml.Decoder, start xml.StartEleme
return err
}
c.Items = append(c.Items, &value)
case "pic":
var value Picture
err = d.DecodeElement(&value, &tt)
if err != nil && !strings.HasPrefix(err.Error(), "expected") {
return err
}
value.XMLPIC = getAtt(tt.Attr, "pic")
c.Items = append(c.Items, &value)
case "wgp":
var value WordprocessingGroup
value.file = c.file
err = d.DecodeElement(&value, &tt)
if err != nil && !strings.HasPrefix(err.Error(), "expected") {
return err
}
c.Items = append(c.Items, &value)
default:
err = d.Skip() // skip unsupported tags
if err != nil {