wasinger / htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler
MIT License
346 stars 50 forks source link

Wrapped nodes retains position of first node in list #12

Closed ttk closed 8 years ago

ttk commented 8 years ago

Taking the position of the first node being wrapped is what jQuery does. The old behaviour is to append the wrapped elements to the parent, which is wrong.

ttk commented 8 years ago

Added unwrapInner, and updated unwrap() to behave the way jquery does.

wasinger commented 8 years ago

@ttk, thank you very much for your contribution. Would you please add some unit tests for the changed behavior of wrapAll and unwrap (i.e. test cases that fail on the old behavior but pass with your changes) and the new method unwrapInner.

ttk commented 8 years ago

Unit tests added!