1
0
mirror of https://github.com/danog/blackfriday.git synced 2024-11-26 12:04:46 +01:00

Add Node.IsLeaf

This commit is contained in:
Tom Payne 2019-04-23 22:12:31 +02:00
parent b98aa06008
commit d96905437e

View File

@ -239,6 +239,11 @@ func (n *Node) IsContainer() bool {
}
}
// IsLeaf returns true if 'n' is a leaf node.
func (n *Node) IsLeaf() bool {
return !n.IsContainer()
}
func (n *Node) canContain(t NodeType) bool {
if n.Type == List {
return t == Item