AddMatcher adds the matcher's matching nodes to those in the current selection and returns a new Selection object. The matcher is run in the context of the document of the current Selection object.
(m Matcher)
| 15 | // The matcher is run in the context of the document of the current |
| 16 | // Selection object. |
| 17 | func (s *Selection) AddMatcher(m Matcher) *Selection { |
| 18 | return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, m)...) |
| 19 | } |
| 20 | |
| 21 | // AddSelection adds the specified Selection object's nodes to those in the |
| 22 | // current selection and returns a new Selection object. |