WrapMatcher wraps each element in the set of matched elements inside the first element matched by the given matcher. The matched child is cloned before being inserted into the document. It returns the original set of elements.
(m Matcher)
| 357 | // |
| 358 | // It returns the original set of elements. |
| 359 | func (s *Selection) WrapMatcher(m Matcher) *Selection { |
| 360 | return s.wrapNodes(m.MatchAll(s.document.rootNode)...) |
| 361 | } |
| 362 | |
| 363 | // WrapSelection wraps each element in the set of matched elements inside the |
| 364 | // first element in the given Selection. The element is cloned before being |