func closest(n *html.Node, sel cascadia.Selector) *html.Node { for n != nil { if sel.Match(n) { break } n = n.Parent } return n }