Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10057 closed feature (wontfix)

Consistency: no unwrapInner() available.

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: manipulation Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

it is nice that we have a wrapInner() function for wrapping the contents of an element - unfortunately, there is no function which does the opposite: unwrapInner(). As there is a unwrap() function nothing should be wrong adding a the missing unwrapInner() to jQuery.

I'm working on a project which heavily requires wrapping and unwrapping, a solution would be very appreciated!

Change History (3)

comment:1 Changed 8 years ago by timmywil

Component: unfiledmanipulation
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

I think it's simple enough to do a .contents().unwrap(). I'll close as wontfix, but if any of the team feels differently, please reopen.

http://jsfiddle.net/timmywil/67skY/

comment:2 Changed 8 years ago by Rick Waldron

+1

comment:3 Changed 8 years ago by dmethvin

Since you can wrap several levels of stuff around the elements in a .wrap* method I am not sure how we could know what the "wrapper" consisted of anyway. Assuming it is a single parent element is wrong:

This structure may be nested several levels deep, but should contain only one innermost element. The structure will be wrapped around the content of each of the elements in the set of matched elements. -- http://api.jquery.com/wrapInner/

The code best able to determine this is the application, not jQuery.

Note: See TracTickets for help on using tickets.