commit
530e2c3169
|
@ -66,7 +66,7 @@ func forEachNode(n *html.Node, pre, post func(n *html.Node)) {
|
|||
}
|
||||
```
|
||||
|
||||
该函数接收2个函数作为参数,分别在结点的孩子被访问前和访问后调用。这样的设计给调用者更大的灵活性。举个例子,现在我们有startElemen和endElement两个函数用于输出HTML元素的开始标签和结束标签`<b>...</b>`:
|
||||
该函数接收2个函数作为参数,分别在结点的孩子被访问前和访问后调用。这样的设计给调用者更大的灵活性。举个例子,现在我们有startElement和endElement两个函数用于输出HTML元素的开始标签和结束标签`<b>...</b>`:
|
||||
|
||||
```Go
|
||||
var depth int
|
||||
|
|
Loading…
Reference in New Issue