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
请先登录再写评论。
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)
THX! Works perfect.
Thanks in advance!, But what if i want remove all tag with content??
Iliyabrook1987
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.
But in general that would be using the Extend Selection (a few times in a row) and then just Delete.