Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions htmldoc/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ func (doc *Document) Parse() {
// Internal recursive function that delves into the node tree and captures
// nodes of interest and node id/names.
func (doc *Document) parseNode(n *html.Node) {
// Ignore this tree if data-proofer-ignore set
if doc.ignoreTagAttribute != "" &&
(AttrPresent(n.Attr, doc.ignoreTagAttribute) || ClassPresent(n.Attr, doc.ignoreTagAttribute)) {
// Remove this tree and ignore if data-proofer-ignore set
if doc.ignoreTagAttribute != "" &&
(AttrPresent(n.Attr, doc.ignoreTagAttribute) || ClassPresent(n.Attr, doc.ignoreTagAttribute)) {
var nextSibling *html.Node
for c := n.FirstChild; c != nil; c = nextSibling {
nextSibling = c.NextSibling
n.RemoveChild(c)
}
return
}

Expand Down