diff options
author | ale <ale@incal.net> | 2018-08-31 08:28:51 +0100 |
---|---|---|
committer | ale <ale@incal.net> | 2018-08-31 08:28:51 +0100 |
commit | b3d419486a87c9193c2fd6c16168f600876e0f73 (patch) | |
tree | 849d1333d4fac8e5654e65a0fdf4b2cb00355ab9 /vendor/github.com/PuerkitoBio/goquery/expand.go | |
parent | 86a0bd2d15a07662fdae4e24589b08706c2e80b9 (diff) | |
download | crawl-b3d419486a87c9193c2fd6c16168f600876e0f73.tar.gz crawl-b3d419486a87c9193c2fd6c16168f600876e0f73.zip |
Update dependencies
Diffstat (limited to 'vendor/github.com/PuerkitoBio/goquery/expand.go')
-rw-r--r-- | vendor/github.com/PuerkitoBio/goquery/expand.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/github.com/PuerkitoBio/goquery/expand.go b/vendor/github.com/PuerkitoBio/goquery/expand.go index f0c6c86..7caade5 100644 --- a/vendor/github.com/PuerkitoBio/goquery/expand.go +++ b/vendor/github.com/PuerkitoBio/goquery/expand.go @@ -41,6 +41,30 @@ func (s *Selection) AddNodes(nodes ...*html.Node) *Selection { // AndSelf adds the previous set of elements on the stack to the current set. // It returns a new Selection object containing the current Selection combined // with the previous one. +// Deprecated: This function has been deprecated and is now an alias for AddBack(). func (s *Selection) AndSelf() *Selection { + return s.AddBack() +} + +// AddBack adds the previous set of elements on the stack to the current set. +// It returns a new Selection object containing the current Selection combined +// with the previous one. +func (s *Selection) AddBack() *Selection { return s.AddSelection(s.prevSel) } + +// AddBackFiltered reduces the previous set of elements on the stack to those that +// match the selector string, and adds them to the current set. +// It returns a new Selection object containing the current Selection combined +// with the filtered previous one +func (s *Selection) AddBackFiltered(selector string) *Selection { + return s.AddSelection(s.prevSel.Filter(selector)) +} + +// AddBackMatcher reduces the previous set of elements on the stack to those that match +// the mateher, and adds them to the curernt set. +// It returns a new Selection object containing the current Selection combined +// with the filtered previous one +func (s *Selection) AddBackMatcher(m Matcher) *Selection { + return s.AddSelection(s.prevSel.FilterMatcher(m)) +} |