MCPcopy Create free account
hub / github.com/antchfx/htmlquery / getCurrentNode

Function getCurrentNode

query.go:150–165  ·  view source on GitHub ↗
(n *NodeNavigator)

Source from the content-addressed store, hash-verified

148}
149
150func getCurrentNode(n *NodeNavigator) *html.Node {
151 if n.NodeType() == xpath.AttributeNode {
152 childNode := &html.Node{
153 Type: html.TextNode,
154 Data: n.Value(),
155 }
156 return &html.Node{
157 Type: html.ElementNode,
158 Data: n.LocalName(),
159 FirstChild: childNode,
160 LastChild: childNode,
161 }
162
163 }
164 return n.curr
165}
166
167// Parse returns the parse tree for the HTML from the given Reader.
168func Parse(r io.Reader) (*html.Node, error) {

Callers 2

QuerySelectorFunction · 0.85
QuerySelectorAllFunction · 0.85

Calls 3

NodeTypeMethod · 0.80
ValueMethod · 0.80
LocalNameMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…