shouldwork

This commit is contained in:
2026-02-12 00:33:05 +03:00
parent 12b9af4c01
commit d5b8c8fd12
4 changed files with 19 additions and 5 deletions

View File

@@ -20,13 +20,13 @@ var ErrNotAnElementNode = errors.New("not an ElementNode")
func parseFragment(s string) (*html.Node, error) {
n, err := html.ParseFragment(strings.NewReader(s), body)
if err != nil {
return n, err
return nil, err
}
return n[0], nil
}
func MatchElemAttr(s string, n2 *html.Node) (bool, error) {
n1, err := parseFragemnt(s)
n1, err := parseFragment(s)
if err != nil {
return false, err
}
@@ -67,7 +67,7 @@ func SearchElemAttr2(s string, n2 *html.Node) (chan *html.Node, error) {
}()
if r := recover(); r != nil {
return nil, r
return nil, r.(error)
}
return <-ch, nil
return ch, nil
}