// matchEmpty checks if a node only has comments or whitespace as direct children.
matchEmpty checks if a node only has comments or whitespace as direct children.
// matchEmpty checks if a node only has comments or whitespace as direct children .
func matchEmpty(n *html.Node) bool {
	for child := n.FirstChild; child != nil; child = child.NextSibling {
		switch child.Type {
		case html.CommentNode:
			continue
		case html.TextNode:
			if !isSpace(child.Data) {
				return false
			}
			continue
		case html.ErrorNode:
			continue
		default:
			return false
		}
	}
	return true
}
func matchEmpty ( n * html . Node ) bool { for child := n . FirstChild ; child != nil ; child = child . NextSibling { switch child . Type { case html . CommentNode : continue case html . TextNode : if ! isSpace ( child . Data ) { return false } continue case html . ErrorNode : continue default : return false } } return true }
matchEmpty checks if a node only has comments or whitespace as direct children.
matchEmpty checks if a node only has comments or whitespace as direct children .