-
-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding duplicate child element broken #1484
Comments
I'm not sure I understand this bug report, as you haven't specified what output you're actually seeing with your version of nokogiri, nor what you expect to see. The output I see using this nokogiri:
is
which is exactly what I expect, since you're taking the node and putting it back where it came from. At no point are you copying the node. If you want to make a copy of the node, then make the copy using |
I would expect that the If I used some method called If I just select an element though and use |
Thanks for explaining your expectations. Unfortunately, this is how There are lots of tests for this, if you'd like to dig into them to better understand the intention of this method. I'm also happy to consider a pull request to make the documentation for
|
This is related to #1200
I have a reproducer here:
https://gist.github.com/akostadinov/f450c1282cd10e2045befc70db9c506a
Basically duplicating an element under same parent does not work unless the element is
element.dup
before adding it as a second child.The text was updated successfully, but these errors were encountered: