From 4fd0a7672777f0ed15692ae2ba47838208537558 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 27 Nov 2022 00:42:16 +0100 Subject: Update dependencies (#1929) --- vendor/github.com/gomarkdown/markdown/ast/node.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/gomarkdown/markdown/ast') 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 -- cgit v1.2.3