MCPcopy
hub / github.com/PuerkitoBio/goquery / nodeName

Function nodeName

utilities.go:44–58  ·  view source on GitHub ↗

nodeName returns the node name of the given html node. See NodeName for additional details on behaviour.

(node *html.Node)

Source from the content-addressed store, hash-verified

42// nodeName returns the node name of the given html node.
43// See NodeName for additional details on behaviour.
44func nodeName(node *html.Node) string {
45 if node == nil {
46 return ""
47 }
48
49 switch node.Type {
50 case html.ElementNode, html.DoctypeNode:
51 return node.Data
52 default:
53 if int(node.Type) < len(nodeNames) {
54 return nodeNames[node.Type]
55 }
56 return ""
57 }
58}
59
60// Render renders the HTML of the first item in the selection and writes it to
61// the writer. It behaves the same as OuterHtml but writes to w instead of

Callers 4

WrapHtmlMethod · 0.85
WrapInnerHtmlMethod · 0.85
eachNodeHtmlMethod · 0.85
NodeNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…