aboutsummaryrefslogtreecommitdiff
path: root/internal/testing/htmlcheck/query.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/testing/htmlcheck/query.go')
-rw-r--r--internal/testing/htmlcheck/query.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/testing/htmlcheck/query.go b/internal/testing/htmlcheck/query.go
index 75a196dd..fe594150 100644
--- a/internal/testing/htmlcheck/query.go
+++ b/internal/testing/htmlcheck/query.go
@@ -7,6 +7,7 @@ package htmlcheck
import (
"errors"
"fmt"
+ "slices"
"strconv"
"strings"
@@ -317,10 +318,8 @@ func (s *classSelector) match(n *html.Node) bool {
}
for _, attr := range n.Attr {
if attr.Key == "class" {
- for _, f := range strings.Fields(attr.Val) {
- if f == s.class {
- return true
- }
+ if slices.Contains(strings.Fields(attr.Val), s.class) {
+ return true
}
break
}