fix fetching errata after html changed

This commit is contained in:
Mechiel Lukkien
2023-06-27 19:31:47 +02:00
parent e58fe31dd1
commit 4819180de1
2 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,7 @@ func main() {
xcheckf(err, "write")
// We will visit the html nodes. We skip <form>'s. We turn on text
// output when we encounter an h3, and we stop again when we see a div
// output when we encounter an h4, and we stop again when we see a div
// or form. This works at the moment, but may break in the future.
output := false
var walk func(*html.Node)
@ -39,7 +39,7 @@ func main() {
if n.Data == "form" {
return
}
if !output && n.Data == "h3" {
if !output && n.Data == "h4" {
output = true
} else if output && (n.Data == "div" || n.Data == "form") {
output = false