func getData(t html.Token, dt html.Token) (ok bool, href string, descr string) { for _, a := range t.Attr { if a.Key == "href" { href = a.Val descr = dt.String() } if a.Key == "class" { if strings.HasPrefix(a.Val, "title may-blank") { ok = true } } } return }
func swapBrackets(token html.Token) string { t := token.String() t = strings.Replace(t, "<", "<", 1) return strings.Replace(t, ">", ">", 1) }