MCPcopy Create free account
hub / github.com/cogentcore/core / ReadHTML

Function ReadHTML

htmlcore/html.go:20–26  ·  view source on GitHub ↗

ReadHTML reads HTML from the given [io.Reader] and adds corresponding Cogent Core widgets to the given [core.Widget], using the given context.

(ctx *Context, parent core.Widget, r io.Reader)

Source from the content-addressed store, hash-verified

18// ReadHTML reads HTML from the given [io.Reader] and adds corresponding
19// Cogent Core widgets to the given [core.Widget], using the given context.
20func ReadHTML(ctx *Context, parent core.Widget, r io.Reader) error {
21 n, err := html.Parse(r)
22 if err != nil {
23 return fmt.Errorf("error parsing HTML: %w", err)
24 }
25 return readHTMLNode(ctx, parent, n)
26}
27
28// ReadHTMLString reads HTML from the given string and adds corresponding
29// Cogent Core widgets to the given [core.Widget], using the given context.

Callers 2

ReadMDFunction · 0.85
ReadHTMLStringFunction · 0.85

Calls 3

readHTMLNodeFunction · 0.85
ParseMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected