Remove html tag and keep childs

Hi,

somethimes I want to remove an html-tag an keep it's child elements.

I'm sure, phpstorm can do this, but how?

Example:

<div id="outer">
<div id="inner">
</div>
</div>

Now I want to remove #outer and get this:

<div id="inner">
</div>

STRG+SHIFT+DEL > Remove enclosing tag removes #inner to.

 

My workaround is to copy the inner to clipboard, remove #outer and paste #inner. 

 

Thx, Sebastian

2

Hi there,

"Code | Unwrap/Remove..." works fine here:

Original file (notice caret position)

Invoking action and choosing right element (depends on caret position -- if caret was invoked 1 line up you will see only 1 "div" entry)

Result:

 (using PhpStorm 2016.3.2 on Window 10)

6
Avatar
Permanently deleted user

THX! Works perfect.

0

Thanks in advance!, But what if i want remove all tag with content?? 

0

Iliyabrook1987

But what if i want remove all tag with content?? 

Sure, please do the same what Original Poster did: please provide a simple code snippet. This is to be sure that we are talking about the same thing.

  • what I have
  • what I want to remove
  • this is what I want to have in the end

But in general that would be using the Extend Selection (a few times in a row) and then just Delete.

0

请先登录再写评论。