mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
Add Node.IsLeaf
This commit is contained in:
parent
b98aa06008
commit
d96905437e
5
node.go
5
node.go
|
@ -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 {
|
func (n *Node) canContain(t NodeType) bool {
|
||||||
if n.Type == List {
|
if n.Type == List {
|
||||||
return t == Item
|
return t == Item
|
||||||
|
|
Loading…
Reference in New Issue
Block a user