Skip to content

Commit

Permalink
fix #49, remove the duplicate node checking, avoid missing some attri…
Browse files Browse the repository at this point in the history
…bute nodes that have the same value.
  • Loading branch information
zhengchun committed Nov 25, 2021
1 parent a091ad3 commit 810ee80
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ func QuerySelectorAll(top *html.Node, selector *xpath.Expr) []*html.Node {
for t.MoveNext() {
nav := t.Current().(*NodeNavigator)
n := getCurrentNode(nav)
// avoid adding duplicate nodes.
if len(elems) > 0 && (elems[0] == n || (nav.NodeType() == xpath.AttributeNode &&
nav.LocalName() == elems[0].Data && nav.Value() == InnerText(elems[0]))) {
continue
}
elems = append(elems, n)
}
return elems
Expand Down

0 comments on commit 810ee80

Please sign in to comment.