It seems that the nodup fix from #6 causes attributes that have the same value with the first result to be discarded
Example (only used for testing) taken from #20 and adjusted
package main
import (
"fmt"
"strings"
"github.com/antchfx/htmlquery"
)
func main() {
t := []string{
"<span class='output' sup='24'></span><span class='output' sup='24'></span><span class='output' sup='45'></span>",
"<span class='output' sup='24'></span><span class='output' sup='45'></span><span class='output' sup='45'></span>",
"<span class='output' sup='45'></span><span class='output' sup='24'></span><span class='output' sup='45'></span>",
}
for _, s := range t {
doc, _ := htmlquery.Parse(strings.NewReader(s))
nx, _ := htmlquery.QueryAll(doc, "//span[@class='output']/@sup")
for _, n := range nx {
fmt.Println(htmlquery.InnerText(n))
}
fmt.Println("--")
}
}
It seems that the nodup fix from #6 causes attributes that have the same value with the first result to be discarded Example (only used for testing) taken from #20 and adjusted
Output
Expected Output