nodeString returns the given node as starting and ending strings in the format: and It returns "", "" if the given node is not an [html.ElementNode]
(n *html.Node)
| 53 | // |
| 54 | // It returns "", "" if the given node is not an [html.ElementNode] |
| 55 | func nodeString(n *html.Node) (start, end string) { |
| 56 | if n.Type != html.ElementNode { |
| 57 | return |
| 58 | } |
| 59 | tag := n.Data |
| 60 | start = "<" + tag |
| 61 | for _, a := range n.Attr { |
| 62 | start += " " + a.Key + "=" + `"` + a.Val + `"` |
| 63 | } |
| 64 | start += ">" |
| 65 | end = "</" + tag + ">" |
| 66 | return |
| 67 | } |
| 68 | |
| 69 | // textTags are all of the node tags that result in a true return value for [isText]. |
| 70 | var textTags = []string{ |
no outgoing calls
no test coverage detected