Skip to content

Commit

Permalink
干员查询天赋缺失修复
Browse files Browse the repository at this point in the history
  • Loading branch information
IJNKAWAKAZE committed Sep 12, 2024
1 parent f2157f0 commit 8cde51e
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/plugins/operator/parse_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,17 @@ func ParseOperator(name string) Operator {
doc.Find("h2").Each(func(i int, selection *goquery.Selection) {
if selection.Text() == "天赋" {
selection.NextFilteredUntil(".wikitable", "h2").Each(func(j int, selection *goquery.Selection) {
if j == 0 {
selection.Find("td").Each(func(k int, selection *goquery.Selection) {
if k%3 == 0 {
var talent Talent
talentName := strings.ReplaceAll(selection.Text(), "\n", "")
talent.Evolve = strings.ReplaceAll(selection.Next().Text(), "\n", "")
desc, _ := selection.Next().Next().Html()
talent.Name = talentName
talent.Desc = template.HTML(desc)
talents = append(talents, talent)
}
})
}
selection.Find("td").Each(func(k int, selection *goquery.Selection) {
if k%3 == 0 {
var talent Talent
talentName := strings.ReplaceAll(selection.Text(), "\n", "")
talent.Evolve = strings.ReplaceAll(selection.Next().Text(), "\n", "")
desc, _ := selection.Next().Next().Html()
talent.Name = talentName
talent.Desc = template.HTML(desc)
talents = append(talents, talent)
}
})
})
}
})
Expand Down

0 comments on commit 8cde51e

Please sign in to comment.