soup icon indicating copy to clipboard operation
soup copied to clipboard

findOnce break after the first child node.

Open knuppe opened this issue 4 years ago • 0 comments

If the element is not found in the first child node, the value is returned, and the loop has no effect.

I think this should be if q {

for c := n.FirstChild; c != nil; c = c.NextSibling {
	p, q := findOnce(c, args, true, strict)
	if !q {
		return p, q
	}
}

https://github.com/anaskhan96/soup/blob/cb47551b378185a4504cf253c2abfbeea361cabf/soup.go#L504

knuppe avatar Jan 24 '21 14:01 knuppe