summaryrefslogtreecommitdiffstats
path: root/document.go
diff options
context:
space:
mode:
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()