summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gomarkdown/markdown/ast
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown/ast')
-rw-r--r--vendor/github.com/gomarkdown/markdown/ast/node.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/ast/node.go b/vendor/github.com/gomarkdown/markdown/ast/node.go
index e2031193..1d558dd3 100644
--- a/vendor/github.com/gomarkdown/markdown/ast/node.go
+++ b/vendor/github.com/gomarkdown/markdown/ast/node.go
@@ -157,9 +157,13 @@ func (l *Leaf) GetChildren() []Node {
return nil
}
-// SetChildren will panic becuase Leaf cannot have children
+// SetChildren will panic if trying to set non-empty children
+// because Leaf cannot have children
func (l *Leaf) SetChildren(newChildren []Node) {
- panic("leaf node cannot have children")
+ if len(newChildren) != 0 {
+ panic("leaf node cannot have children")
+ }
+
}
// Document represents markdown document node, a root of ast