mirror of
https://github.com/PuerkitoBio/goquery.git
synced 2024-04-21 12:31:36 +00:00
doc: clarify how RemoveFiltered works
This commit is contained in:
+9
-4
@@ -212,14 +212,19 @@ func (s *Selection) Remove() *Selection {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveFiltered removes the set of matched elements by selector.
|
// RemoveFiltered removes from the current set of matched elements those that
|
||||||
// It returns the Selection of removed nodes.
|
// match the selector filter. It returns the Selection of removed nodes.
|
||||||
|
//
|
||||||
|
// For example if the selection s contains "<h1>", "<h2>" and "<h3>"
|
||||||
|
// and s.RemoveFiltered("h2") is called, only the "<h2>" node is removed
|
||||||
|
// (and returned), while "<h1>" and "<h3>" are kept in the document.
|
||||||
func (s *Selection) RemoveFiltered(selector string) *Selection {
|
func (s *Selection) RemoveFiltered(selector string) *Selection {
|
||||||
return s.RemoveMatcher(compileMatcher(selector))
|
return s.RemoveMatcher(compileMatcher(selector))
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveMatcher removes the set of matched elements.
|
// RemoveMatcher removes from the current set of matched elements those that
|
||||||
// It returns the Selection of removed nodes.
|
// match the Matcher filter. It returns the Selection of removed nodes.
|
||||||
|
// See RemoveFiltered for additional information.
|
||||||
func (s *Selection) RemoveMatcher(m Matcher) *Selection {
|
func (s *Selection) RemoveMatcher(m Matcher) *Selection {
|
||||||
return s.FilterMatcher(m).Remove()
|
return s.FilterMatcher(m).Remove()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user