MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / parseHtmlWithContext

Function parseHtmlWithContext

manipulation.go:577–585  ·  view source on GitHub ↗
(h string, context *html.Node, opts []html.ParseOption)

Source from the content-addressed store, hash-verified

575}
576
577func parseHtmlWithContext(h string, context *html.Node, opts []html.ParseOption) []*html.Node {
578 // Errors are only returned when the io.Reader returns any error besides
579 // EOF, but strings.Reader never will
580 nodes, err := html.ParseFragmentWithOptions(strings.NewReader(h), context, opts...)
581 if err != nil {
582 panic("goquery: failed to parse HTML: " + err.Error())
583 }
584 return nodes
585}
586
587// Get the first child that is an ElementNode
588func getFirstChildEl(n *html.Node) *html.Node {

Callers 3

WrapAllHtmlMethod · 0.85
parseHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected