OutputHTML returns the text including tags name.
(n *html.Node, self bool)
| 222 | |
| 223 | // OutputHTML returns the text including tags name. |
| 224 | func OutputHTML(n *html.Node, self bool) string { |
| 225 | var b strings.Builder |
| 226 | if self { |
| 227 | html.Render(&b, n) |
| 228 | } else { |
| 229 | for n := n.FirstChild; n != nil; n = n.NextSibling { |
| 230 | html.Render(&b, n) |
| 231 | } |
| 232 | } |
| 233 | return b.String() |
| 234 | } |
| 235 | |
| 236 | type NodeNavigator struct { |
| 237 | root, curr *html.Node |