INNER CODE UNIT · Go
nextNode
JohannesKaufmann/html-to-markdown · collapse/collapse.go:53
func nextNode(prev *html.Node, current *html.Node, domFuncs *DomFuncs) *html.Node {
if (prev != nil && prev.Parent == current) || domFuncs.IsPreformattedNode(current) {
if current.NextSibling != nil {
return current.NextSibling
}
return current.Parent
}
if current.FirstChild != nil {
return current.FirstChild
}
if current.NextSibling != nil {
return current.NextSibling
}
return current.Parent
}