(n *NodeNavigator)
| 148 | } |
| 149 | |
| 150 | func getCurrentNode(n *NodeNavigator) *html.Node { |
| 151 | if n.NodeType() == xpath.AttributeNode { |
| 152 | childNode := &html.Node{ |
| 153 | Type: html.TextNode, |
| 154 | Data: n.Value(), |
| 155 | } |
| 156 | return &html.Node{ |
| 157 | Type: html.ElementNode, |
| 158 | Data: n.LocalName(), |
| 159 | FirstChild: childNode, |
| 160 | LastChild: childNode, |
| 161 | } |
| 162 | |
| 163 | } |
| 164 | return n.curr |
| 165 | } |
| 166 | |
| 167 | // Parse returns the parse tree for the HTML from the given Reader. |
| 168 | func Parse(r io.Reader) (*html.Node, error) { |
no test coverage detected
searching dependent graphs…