ExtractText recursively extracts all of the text from the children of the given [*html.Node], adding any appropriate inline markup for formatted text. It adds any non-text elements to the given [core.Widget] using [readHTMLNode]. It should not be called on text nodes themselves; for that, you can di
(ctx *Context)
| 18 | // the given page URL for context when resolving URLs, but it can be |
| 19 | // omitted if not available. |
| 20 | func ExtractText(ctx *Context) string { |
| 21 | if ctx.Node.FirstChild == nil { |
| 22 | return "" |
| 23 | } |
| 24 | return extractText(ctx, ctx.Node.FirstChild) |
| 25 | } |
| 26 | |
| 27 | func extractText(ctx *Context, n *html.Node) string { |
| 28 | str := "" |
no test coverage detected