Skip to content

Commit

Permalink
removed class extraction for body tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jakopako committed Jun 18, 2023
1 parent 7f4edf0 commit 4d078ab
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions automate/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,25 +503,27 @@ parse:
moreAttr := true
var hrefVal string
var cls []string
for moreAttr {
k, v, m := z.TagAttr()
vString := strings.TrimSpace(string(v))
if string(k) == "class" && vString != "" {
cls = strings.Split(vString, " ")
j := 0
for _, cl := range cls {
// for now we ignore classes that contain dots
if cl != "" && !strings.Contains(cl, ".") {
cls[j] = cl
j++
if tnString != "body" { // we don't care about classes for the body tag
for moreAttr {
k, v, m := z.TagAttr()
vString := strings.TrimSpace(string(v))
if string(k) == "class" && vString != "" {
cls = strings.Split(vString, " ")
j := 0
for _, cl := range cls {
// for now we ignore classes that contain dots
if cl != "" && !strings.Contains(cl, ".") {
cls[j] = cl
j++
}
}
cls = cls[:j]
}
cls = cls[:j]
}
if string(k) == "href" {
hrefVal = string(v)
if string(k) == "href" {
hrefVal = string(v)
}
moreAttr = m
}
moreAttr = m
}
var pCls []string
// only add nth-child if there has been another node before at the same
Expand Down

0 comments on commit 4d078ab

Please sign in to comment.