Export Node.IsContainer
Tom Payne twpayne@gmail.com
Tue, 23 Apr 2019 22:10:42 +0200
1 files changed,
4 insertions(+),
3 deletions(-)
jump to
M
node.go
→
node.go
@@ -199,7 +199,8 @@ sibling.Parent.FirstChild = sibling
} } -func (n *Node) isContainer() bool { +// IsContainer returns true if 'n' can contain children. +func (n *Node) IsContainer() bool { switch n.Type { case Document: fallthrough@@ -309,11 +310,11 @@ }
} func (nw *nodeWalker) next() { - if (!nw.current.isContainer() || !nw.entering) && nw.current == nw.root { + if (!nw.current.IsContainer() || !nw.entering) && nw.current == nw.root { nw.current = nil return } - if nw.entering && nw.current.isContainer() { + if nw.entering && nw.current.IsContainer() { if nw.current.FirstChild != nil { nw.current = nw.current.FirstChild nw.entering = true