Skip to content

Commit

Permalink
Allow selectors to work with unknown tags
Browse files Browse the repository at this point in the history
  • Loading branch information
andremarianiello committed Feb 23, 2019
1 parent 8f884ca commit f811b2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion display.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func jsonify(node *html.Node) map[string]interface{} {
}
}
}
vals["tag"] = node.DataAtom.String()
vals["tag"] = node.Data
children := []interface{}{}
for child := node.FirstChild; child != nil; child = child.NextSibling {
switch child.Type {
Expand Down
2 changes: 1 addition & 1 deletion selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (s CSSSelector) Match(node *html.Node) bool {
return false
}
if s.Tag != "" {
if s.Tag != node.DataAtom.String() {
if s.Tag != node.Data {
return false
}
}
Expand Down

0 comments on commit f811b2e

Please sign in to comment.