func endSentenceWithNode(n *h5.Node) bool { for _, v := range endSentenceElementTypes { if v == n.Data() { // || (n.Parent != nil && v == n.Parent.Data()) { return true } } return false }
func validNodeType(n *h5.Node) bool { switch n.Type { case h5.TextNode: return true case h5.ElementNode: for _, v := range validElementTypes { if v == n.Data() { return true } } } return false }
func _getElementsByTagNameAndClass(e *h5.Node, tag_name string, class string, result *[]*h5.Node) { if tag_name == "" || e.Data() == tag_name { if class == "" { *result = append(*result, e) } else { for _, attr := range e.Attr { if attr.Name == "class" && attr.Value == class { *result = append(*result, e) } } } } for _, child := range e.Children { _getElementsByTagNameAndClass(child, tag_name, class, result) } }