Skip to content

Commit

Permalink
xhtml.Table: Better use of iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
earthboundkid committed May 21, 2024
1 parent cb1d9ff commit dc01120
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/xhtml/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ func Tables(root *html.Node) iter.Seq2[*html.Node, TableNodes] {
tables := SelectSlice(root, WithAtom(atom.Table))
for _, tblNode := range tables {
var tbl TableNodes
rows := SelectSlice(tblNode, WithAtom(atom.Tr))
for _, row := range rows {
for row := range SelectAll(tblNode, WithAtom(atom.Tr)) {
tds := SelectSlice(row, func(n *html.Node) bool {
return n.DataAtom == atom.Td || n.DataAtom == atom.Th
})
Expand Down

0 comments on commit dc01120

Please sign in to comment.