()
| 370 | } |
| 371 | |
| 372 | func (n *TNode) Value() string { |
| 373 | if n.Type == TextNode { |
| 374 | return n.Data |
| 375 | } |
| 376 | |
| 377 | var buff bytes.Buffer |
| 378 | var output func(*TNode) |
| 379 | output = func(node *TNode) { |
| 380 | if node.Type == TextNode { |
| 381 | buff.WriteString(node.Data) |
| 382 | } |
| 383 | for child := node.FirstChild; child != nil; child = child.NextSibling { |
| 384 | output(child) |
| 385 | } |
| 386 | } |
| 387 | output(n) |
| 388 | return buff.String() |
| 389 | } |
| 390 | |
| 391 | // TNodeNavigator is for navigating TNode. |
| 392 | type TNodeNavigator struct { |
nothing calls this directly
no test coverage detected