nodeOwnText returns the contents of the text nodes that are direct children of n.
(n *html.Node)
| 145 | // nodeOwnText returns the contents of the text nodes that are direct |
| 146 | // children of n. |
| 147 | func nodeOwnText(n *html.Node) string { |
| 148 | var b bytes.Buffer |
| 149 | for c := n.FirstChild; c != nil; c = c.NextSibling { |
| 150 | if c.Type == html.TextNode { |
| 151 | b.WriteString(c.Data) |
| 152 | } |
| 153 | } |
| 154 | return b.String() |
| 155 | } |
| 156 | |
| 157 | type nthPseudoClassSelector struct { |
| 158 | abstractPseudoClass |