summaryrefslogtreecommitdiffstats
path: root/document.go
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2017-08-25 15:04:40 +0200
committerclsr <clsr@clsr.net>2017-08-25 15:04:40 +0200
commit4c0470d24b00445b67a5a0accde8538d8c810730 (patch)
tree3f7ad0838d9883e31fa00d54f176bb81ca50a7d4 /document.go
parent0cf5f7a9b1fcb272cd9d632bc76219edd7077c39 (diff)
downloadcnm-go-4c0470d24b00445b67a5a0accde8538d8c810730.tar.gz
cnm-go-4c0470d24b00445b67a5a0accde8538d8c810730.zip
Make TableBlock extend ContentBlock; add AppendChild to ContainerBlock
Diffstat (limited to 'document.go')
-rw-r--r--document.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/document.go b/document.go
index c01837c..65eac3e 100644
--- a/document.go
+++ b/document.go
@@ -23,10 +23,15 @@ type Document struct {
Content *ContentBlock
}
+// NewDocument creates a new Document.
+func NewDocument() *Document {
+ return &Document{}
+}
+
// ParseDocument parses a CNM document from r.
func ParseDocument(r io.Reader) (doc *Document, err error) {
p := NewParser(r)
- doc = &Document{}
+ doc = NewDocument()
err = p.Next()
for err == nil {
token := p.Block()