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

Method wrapInnerNodes

manipulation.go:546–562  ·  view source on GitHub ↗
(ns ...*html.Node)

Source from the content-addressed store, hash-verified

544}
545
546func (s *Selection) wrapInnerNodes(ns ...*html.Node) *Selection {
547 if len(ns) == 0 {
548 return s
549 }
550
551 s.Each(func(i int, s *Selection) {
552 contents := s.Contents()
553
554 if contents.Size() > 0 {
555 contents.wrapAllNodes(ns...)
556 } else {
557 s.AppendNodes(cloneNode(ns[0]))
558 }
559 })
560
561 return s
562}
563
564func parseHtml(h string) []*html.Node {
565 // Errors are only returned when the io.Reader returns any error besides

Callers 4

WrapInnerMatcherMethod · 0.95
WrapInnerSelectionMethod · 0.95
WrapInnerNodeMethod · 0.95
WrapInnerHtmlMethod · 0.80

Calls 6

EachMethod · 0.95
ContentsMethod · 0.95
AppendNodesMethod · 0.95
cloneNodeFunction · 0.85
SizeMethod · 0.80
wrapAllNodesMethod · 0.80

Tested by

no test coverage detected