Commit 85ccf1a
committed
Make Node#{pre,ap}pend_to return the appended node
This commit introduces a slight incompatibility, but hopefully
it's a worthy one.
The rationale is that I often tend to write code like:
`DOM { div }.append_to(other_node)` to construct a DOM tree and
append it in one go. When I try to capture the tree, I can't -
I think it makes no sense to return a parent.
Regarding other cases where this is done this way, I would note
jQuery even if some people may say it's an unpopular comparison,
but I want this library to give jQuery users a familiar interface.
Nokogiri has no say about this - it doesn't have {pre,ap}pend_to.
Do note, that it makes no change to << and >> which should
return a parent node.1 parent 91ddf83 commit 85ccf1a
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| |||
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
| 400 | + | |
399 | 401 | | |
400 | 402 | | |
401 | 403 | | |
| |||
0 commit comments