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)
| 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. |
| 20 | func 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. |
no test coverage detected