1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-10 02:00:24 +08:00

add: anchor drawing & some attrs

This commit is contained in:
源文雨
2023-02-22 17:09:04 +08:00
parent d2666ec617
commit 9f0dbc43d1
8 changed files with 617 additions and 112 deletions

View File

@@ -121,7 +121,7 @@ func (p *Paragraph) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
switch tt.Name.Local {
case "hyperlink":
var value Hyperlink
d.DecodeElement(&value, &start)
d.DecodeElement(&value, &tt)
id := getAtt(tt.Attr, "id")
anchor := getAtt(tt.Attr, "anchor")
if id != "" {
@@ -133,15 +133,15 @@ func (p *Paragraph) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
elem.Link = &value
case "r":
var value Run
d.DecodeElement(&value, &start)
d.DecodeElement(&value, &tt)
elem.Run = &value
case "rPr":
var value RunProperties
d.DecodeElement(&value, &start)
d.DecodeElement(&value, &tt)
elem.Properties = &value
case "pPr":
var value ParagraphProperties
d.DecodeElement(&value, &start)
d.DecodeElement(&value, &tt)
p.Properties = &value
continue
default: