1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-09 17:50:27 +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

@@ -31,6 +31,7 @@ import (
// ParagraphProperties <w:pPr>
type ParagraphProperties struct {
XMLName xml.Name `xml:"w:pPr,omitempty"`
Tabs *Tabs
Spacing *Spacing
Ind *Ind
Justification *Justification
@@ -58,6 +59,13 @@ func (p *ParagraphProperties) UnmarshalXML(d *xml.Decoder, start xml.StartElemen
}
if tt, ok := t.(xml.StartElement); ok {
switch tt.Name.Local {
case "tabs":
var value Tabs
err = d.DecodeElement(&value, &tt)
if err != nil && !strings.HasPrefix(err.Error(), "expected") {
return err
}
p.Tabs = &value
case "spacing":
var value Spacing
err = d.DecodeElement(&value, &tt)