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-10 00:43:36 +08:00
parent cf061a29e4
commit 45efdb3378
6 changed files with 154 additions and 8 deletions

View File

@@ -205,6 +205,7 @@ type RunProperties struct {
Color *Color
Size *Size
SizeCs *SizeCs
Spacing *Spacing
RunStyle *RunStyle
Style *Style
Shade *Shade
@@ -255,6 +256,13 @@ func (r *RunProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElement) err
var value Size
value.Val = getAtt(tt.Attr, "val")
r.Size = &value
case "spacing":
var value Spacing
err = d.DecodeElement(&value, &tt)
if err != nil && !strings.HasPrefix(err.Error(), "expected") {
return err
}
r.Spacing = &value
case "szCs":
var value SizeCs
value.Val = getAtt(tt.Attr, "val")