1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-04 23:30:25 +08:00

add SplitByParagraph

This commit is contained in:
源文雨
2023-03-09 17:20:17 +08:00
parent 2a630f6342
commit 69a899d4a5
12 changed files with 282 additions and 37 deletions

View File

@@ -27,8 +27,8 @@ import (
"strings"
)
// WTable represents a table within a Word document.
type WTable struct {
// Table represents a table within a Word document.
type Table struct {
XMLName xml.Name `xml:"w:tbl,omitempty"`
TableProperties *WTableProperties
TableGrid *WTableGrid
@@ -37,7 +37,7 @@ type WTable struct {
file *Docx
}
func (t *WTable) String() string {
func (t *Table) String() string {
if len(t.TableRows) == 0 || len(t.TableRows[0].TableCells) == 0 {
return ""
}
@@ -62,7 +62,7 @@ func (t *WTable) String() string {
}
// UnmarshalXML implements the xml.Unmarshaler interface.
func (t *WTable) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
func (t *Table) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
for {
token, err := d.Token()
if err == io.EOF {