feat: Add Node#RemoveChild
This commit is contained in:
parent
3a2cfbb8be
commit
947b928a5d
1 changed files with 5 additions and 0 deletions
5
html.go
5
html.go
|
@ -109,6 +109,11 @@ func (n *Node) Children() []*Node {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (n *Node) RemoveChild(other *Node) {
|
||||||
|
// thanks go stdlib!
|
||||||
|
n.Node.RemoveChild(other.Node)
|
||||||
|
}
|
||||||
|
|
||||||
func (n *Node) Traverse(cb func(n *Node)) {
|
func (n *Node) Traverse(cb func(n *Node)) {
|
||||||
var f func(*Node)
|
var f func(*Node)
|
||||||
f = func(n *Node) {
|
f = func(n *Node) {
|
||||||
|
|
Loading…
Reference in a new issue