MCPcopy Create free account
hub / github.com/andybalholm/cascadia / nodeOwnText

Function nodeOwnText

pseudo_classes.go:147–155  ·  view source on GitHub ↗

nodeOwnText returns the contents of the text nodes that are direct children of n.

(n *html.Node)

Source from the content-addressed store, hash-verified

145// nodeOwnText returns the contents of the text nodes that are direct
146// children of n.
147func 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
157type nthPseudoClassSelector struct {
158 abstractPseudoClass

Callers 2

MatchMethod · 0.85
MatchMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected